如何更改 swagger-ui.html 默认路径

新手上路,请多包涵

我想将我的 swagger-ui 路径从 localhost:8080/swagger-ui.html 更改为 localhost:8080/myapi/swagger-ui.htmlspringboot 重定向对我无能为力

原文由 Chen Zhang 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.7k
1 个回答

在 Spring Boot 的 application.properties 中

springdoc.swagger-ui.path=/swagger-ui-custom.html

在你的情况下,它将是

springdoc.swagger-ui.path=/myapi/swagger-ui.html

原文由 Anil Dabas 发布,翻译遵循 CC BY-SA 4.0 许可协议