【发布时间】:2019-10-29 01:33:46
【问题描述】:
我有一个默认上下文路径为“/”的应用程序,但我想将默认上下文路径设为 swagger-ui.html。
假设如果我的应用程序在 8080 上运行,当我输入 localhost:8080 时,应用程序应该重定向到 localhost:8080/swagger-ui.html
我在 application.properties 中添加了以下内容
server.servlet.context-path=/swagger-ui.html
但它不起作用,有人可以帮助我吗
以下是我正在使用的 swagger 依赖项
compile 'io.springfox:springfox-swagger2:2.9.2'
compile 'io.springfox:springfox-swagger-ui:2.9.2'
【问题讨论】:
-
我不认为这是可配置的。但是您可以尝试github.com/springfox/springfox/issues/… 中提到的解决方法
标签: java spring spring-boot swagger-2.0