当我点击swagger-ui url时,我被重定向到一个附加了configUrl的链接。但是新的url不包括方案、主机名或端口。我是不是漏掉了什么场景?
当前属性……
server.servlet.context-path=/
springdoc.swagger-ui.path=/swagger-ui
初始url: http://localhost:8080/swagger-ui
重定向url: swagger-ui/index.html?configUrl =/v3/api文档/swagger-config
任何帮助都太好了。
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>2.3.5.RELEASE</version>
</dependency>
编辑:如果我将上下文路径设置为一个值,即
server.servlet.context-path=/static
一切都按照预期运行,我被重定向到:http: localhost: 8080/静态/swagger-ui/index . html ?configUrl =/静态/v3/api文档/swagger-config
所以-我发现我的问题是什么。这不是导致问题的原因,但改变这个确实解决了我的问题…
在我的属性中设置:
spring.mvc.servlet.path=/
这当然是默认行为,但一旦该属性被删除,一切都按预期工作。