0

When I hit the swagger-ui url I am redirected to a link with the configUrl appended. But the new url doesn't include the scheme, hostname or port. Is there a setting that I am missing?

Current properties...

server.servlet.context-path=/
springdoc.swagger-ui.path=/swagger-ui

initial url: http://localhost:8080/swagger-ui

redirect url: swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config

Any help will be great.

<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>

EDIT: if I set the context-path to a value i.e.

server.servlet.context-path=/static

everything behaves as expected, and I get redirected to: http:localhost:8080/static/swagger-ui/index.html?configUrl=/static/v3/api-docs/swagger-config

1 Answers1

0

So - I found what my problem was. Not the reason it caused a problem but changing this does fix my problem...

Somewhere in my properties I was setting:

spring.mvc.servlet.path=/

this is of course the default behavior, but once that property was removed everything works as expected.