Setup:
I am using the Java library springdoc-openapi-ui
in version 1.4.0 (via Maven) without any customization in a simple spring-boot project.
The Swagger page is generated under https://my-url.com/my-context-path/swagger-ui/index.html
and the api-docs under https://my-url.com/my-context-path/v3/api-docs/
both of these work and I can reach them. So far so good!
Now the problem:
When simply navigating to https://my-url.com/my-context-path/swagger-ui.html I am getting a HTTP Status 302 and a location
attribute set in the response header that is supposed to redirect me to the swagger page from above (I assume).
However, the URL in the location
attribute misses the context path! It looks like this:
https://my-url.com/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config
It redirects to a page that does not exist and I am getting a 404 error code. Note, that the configUrl also seems to be missing the context-path.
Any ideas why this occurs and how it can be fixed?
This Github Issue seemed to be the same problem, but in the end it is stated that the problem is fixed: https://github.com/springdoc/springdoc-openapi/issues/37 and that is for a previous version than mine.