Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lfvjimisola opened this issue Oct 6, 2023 · 3 comments
Open

Comments

@lfvjimisola
Copy link

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>

@cristian-daramus
Copy link

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
Copy link
Author

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

@codespearhead
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants