【发布时间】:2018-09-17 07:44:05
【问题描述】:
我的 Spring Boot 应用程序有一个如下所示的 contextPath
server.contextPath=/api
我已经添加了 springfox swagger 配置,并且能够从给定的 url 中获取 swagger url,如下所示
http://localhost:8080/api/swagger-ui.html
实际上我想要的是在 contextPath 之外获得 swagger ui,如下所示
http://localhost:8080/swagger-ui.html
想知道这是否可行。
【问题讨论】:
-
然后从属性文件中删除 server.contextPath=/api
-
感谢您的回复....我无法删除我的应用程序的 contextPath...任何其他方式而不是删除 contextPath
-
那你为什么要拥有任何上下文路径的应用程序?
-
Spring Boot 应用程序已经有使用此上下文路径的 api...并且客户端要求不要为 swagger ui 使用应用程序上下文路径
-
您的问题不清楚,您是说,您将使用 swagger 而不使用上下文路径,但您不会删除上下文路径。那你觉得怎么做呢?
标签: java spring-boot swagger-ui swagger-2.0 springfox