I have a maven Spring Boot project that uses Webflux. I generate the open api spec into an output file using springdoc-openapi-maven-plugin
in my pom:
<plugin>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<apiDocsUrl>http://localhost:8080/v3/api-docs</apiDocsUrl>
<outputFileName>openapi.json</outputFileName>
<outputDir>${project.basedir}/target</outputDir>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
I also added the springdoc-openapi-webflux-ui
dependency in my pom:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>1.4.8</version>
</dependency>
The above setup was working all fine and a new openapi.json
file was generated each time I compiled.
However, I had a need to add a prefix for all my API paths. So I ended up adding a spring.webflux.base-path
property in my application.yml
file, which worked as expected.
spring:
webflux:
base-path: "/myproject"
Once I did this, open api was not able to generate the output file (openapi.json
) anymore. Is this expected? Is there a way to debug open api related errors?
question from:
https://stackoverflow.com/questions/65943173/springdoc-openapi-maven-plugin-not-generating-output-file-when-used-with-spring 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…