springdoc-openapi-maven-plugin
springdoc-openapi-maven-plugin copied to clipboard
Will the plugin generate multiple files if GroupedOpenAPI is used?
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-
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
Thanks, but we need a solution that is dynamic (in terms of number of APIs) rather than hardcoded.
Possible duplicate of https://github.com/springdoc/springdoc-openapi/issues/2539