问题描述
我有一个使用 Webflux 的 maven Spring Boot 项目。我在 pom 中使用 springdoc-openapi-maven-plugin
将打开的 api 规范生成到输出文件中:
<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>
我还在我的 pom 中添加了 springdoc-openapi-webflux-ui
依赖项:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webflux-ui</artifactId>
<version>1.4.8</version>
</dependency>
上述设置一切正常,每次编译时都会生成一个新的 openapi.json
文件。
但是,我需要为所有 API 路径添加前缀。所以我最终在我的 spring.webflux.base-path
文件中添加了一个 application.yml
属性,它按预期工作。
spring:
webflux:
base-path: "/myproject"
执行此操作后,open api 无法再生成输出文件 (openapi.json
)。这是预期的吗?有没有办法调试open api相关的错误?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)