【问题标题】:Spring-Doc open api not working with Spring cloud config server @EnableConfigServerSpring-Doc open api不适用于Spring云配置服务器@EnableConfigServer
【发布时间】:2020-11-24 05:50:06
【问题描述】:

我正在使用 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":[

   ]
}

而不是像预期的那样招摇的用户界面。我不确定它是否是一个错误,但希望能提供任何帮助。

【问题讨论】:

  • 您好!你找到解决办法了吗?

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


【解决方案1】:

不确定是否与在 spring 云配置服务器上添加 springdoc 依赖相关,除非您需要在自己的配置服务器上探索一些 API。

这是一个使用 springdoc 和配置服务器的完整示例的链接:

这是一个博客的链接,它解释了微服务和 Spring Cloud 模块的自然用法:

【讨论】:

  • 我完全确认以下示例运行良好。谢谢布赖恩布罗。
猜你喜欢
  • 1970-01-01
  • 2018-05-15
  • 2019-07-21
  • 2019-05-10
  • 2019-10-26
  • 2018-04-14
  • 1970-01-01
  • 2020-10-02
  • 1970-01-01
相关资源
最近更新 更多