Skip to content

Will the plugin generate multiple files if GroupedOpenAPI is used? #64

Open
@lfvjimisola

Description

@lfvjimisola

Will the plugin generate multiple files if GroupedOpenAPI is used?

It does not look like it in the source code: here or here

And if so, how are the filenames generated? openapi-.<json|yaml>

Activity

cristian-daramus

cristian-daramus commented on Oct 13, 2023

@cristian-daramus

Hey, I also needed the plugin to generate multiple files for each GroupedOpenApi so what I did using maven was something like this:

  • I defined 2 GroupedOpenApi: public and private

  • I changed the plugin to execute each group on it's own:

        <plugin>
               <groupId>org.springdoc</groupId>
               <artifactId>springdoc-openapi-maven-plugin</artifactId>
               <version>1.4</version>
               <executions>
                   <execution>
                       <id>public-openapi</id>
                       <goals>
                           <goal>generate</goal>
                       </goals>
                       <configuration>
                           <apiDocsUrl>http://server:port/context-path/v3/api-docs/public</apiDocsUrl>
                           <outputFileName>openapi-public.yaml</outputFileName>
                           <outputDir>${project.basedir}/src/main/</outputDir>
                           <skip>false</skip>
                       </configuration>
                   </execution>
                   <execution>
                       <id>admin-openapi</id>
                       <goals>
                           <goal>generate</goal>
                       </goals>
                       <configuration>
                           <apiDocsUrl>http://server:port/context-path/v3/api-docs/private</apiDocsUrl>
                           <outputFileName>openapi-admin.yaml</outputFileName>
                           <outputDir>${project.basedir}/src/main/</outputDir>
                           <skip>false</skip>
                       </configuration>
                   </execution>
               </executions>
           </plugin>

Hope it helps

lfvjimisola

lfvjimisola commented on Oct 13, 2023

@lfvjimisola
Author

Thanks, but we need a solution that is dynamic (in terms of number of APIs) rather than hardcoded.

codespearhead

codespearhead commented on Apr 1, 2024

@codespearhead

Possible duplicate of springdoc/springdoc-openapi#2539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @codespearhead@lfvjimisola@cristian-daramus

        Issue actions

          Will the plugin generate multiple files if GroupedOpenAPI is used? · Issue #64 · springdoc/springdoc-openapi-maven-plugin