我正在开发一个由以下应用程序组成的微服务项目:-Discovery Server -Gateway -Elemental Service(主微服务)-Chat Service(真实的管理聊天的微服务)。
现在,我想设置Swagger,以便访问URI http://localhost:8080/swagger-ui/可以看到所有微服务API。
我尝试设置以下依赖项:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.0.0</version>
</dependency>
在我的项目的pom.xml和我的网关的pom.xml中,但我仍然无法访问Swagger。
如果我访问Swagger页面,我会得到404错误。
我该怎么解决呢?先谢了。
1条答案
按热度按时间svmlkihl1#
URL通常应该是http://localhost:8080/swagger-ui/index.html或类似的URL,具体取决于您的上下文路径和配置。