我正在使用 spring boot 2.3.2.RELEASE
和 spring-cloud-config-server 2.2.4.RELEASE
。我正在尝试在现有项目中实现 spring-doc-openapi (1.4.3)
。如果我在配置类文件中添加 @EnableConfigServer ,则 swagger-ui.html 端点会返回一个奇怪的 json:
"name":"swagger-ui",
"profiles":[
"index.html"
],
"label":null,
"version":null,
"state":null,
"propertySources":[
]
}
而不是预期的 swagger ui。我不确定这是否是一个错误,但希望得到任何帮助。
最佳答案
不确定是否与在 Spring Cloud 配置服务器上添加 springdoc 依赖项相关,除非您需要在配置服务器本身上探索一些 API。
这里是使用 springdoc 和配置服务器的完整工作示例的链接:
这是一个博客的链接,它解释了微服务和 Spring Cloud 模块的自然用法:
关于spring-boot - Spring-Doc open api 无法与 Spring cloud 配置服务器 @EnableConfigServer 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63241686/