Skip to content

External context path is not respected when using Swagger UI #607

@gcelikkaya

Description

@gcelikkaya

Version: springdoc-openapi-ui 1.3.4

If I deploy my application K8s with some custom path, swagger UI redirection does not work. It looks for the spring context path + springdoc.api-docs.path. So it does not work with relative paths.

Lets say I have:

server.servlet.context-path=/foo
springdoc.api-docs.path=/swagger/api
springdoc.swagger-ui.path=/swagger/ui

But with K8s and Ingress my application runs at http://api.someurl.com/my-custom-path/foo/ and http://api.someurl.com/my-custom-path/foo/swagger/api works fine

But when I visit http://api.someurl.com/my-custom-path/foo/swagger/ui it redirects to http://api.someurl.com/foo/swagger/swagger-ui/index.html?configUrl=/foo/swagger/api/swagger-config

So it removes my-custom-path from the redirected URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions