spring-boot - Spring-Doc open api 无法与 Spring cloud 配置服务器 @EnableConfigServer 一起使用

标签 spring-boot spring-cloud-config springdoc springdoc-openapi-ui springdoc-openui

我正在使用 spring boot 2.3.2.RELEASEspring-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/

相关文章:

java - 从 Spring Cloud Config Server 获取配置时 Spring 配置文件排序不正确

java - Eureka+Cloud-Config 与 Wildfly 和部署顺序

java - Springdoc 中未禁用 Petstore url(swagger 默认应用程序)

Spring 自定义过滤器总是被调用

java - 由于破坏查询的条件,来自 org.springframework.data.mybatis.annotations.Version 的 @Version 在更新时不会增加 1

尽管成功,Spring Security OAuth2 登录重定向到错误页面

java - 使用@DataJpaTest 设置自定义方案

spring-cloud-config - Spring Cloud Config Basic Security 抛出 401 错误

java - 如何在不映射根路径的情况下配置springdoc ui?