【发布时间】:2021-06-01 06:10:44
【问题描述】:
我需要为 Swagger-ui 使用特定的 url。我尝试使用属性“springdoc.swagger-ui.path”,但它只会重定向。
application.properties:
springdoc.swagger-ui.path=/helloWorld/swagger
浏览器中的网址: http://localhost:8181/helloWorld/swagger
但是当点击回车按钮时,网址会变为以下内容:
http://localhost:8181/manager/swagger-ui/index.html?configUrl=/manager/swagger/swagger.json/swagger-config
问题是,我怎样才能使路径只有 http://localhost:8181/helloWorld/swagger/index.html 或 http://localhost:8181/helloWorld /swagger 一旦我按下回车键(我需要“swagger-ui”这个词并且 configUrl 消失)?
我正在使用 Springdoc,甚至尝试过使用 springfox
Pom.xml
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.2</version>
</dependency>
application.properties:
springdoc.api-docs.path=/helloWorld/swagger/swagger.json
springdoc.swagger-ui.path=/helloWorld/swagger
【问题讨论】:
标签: spring spring-boot swagger swagger-ui springdoc