Skip to content

Incorrect configUrl due to null path prefix #1364

Closed
@grantneale

Description

@grantneale

Describe the bug
After upgrading from 1.5.8 to 1.5.12+ the /api-docs/swagger-config endpoint returns an incorrect configUrl (unexpected null prefix):

{
  "configUrl" : "null/api-docs/swagger-config",
  "oauth2RedirectUrl" : "http://localhost:8080/swagger-ui/oauth2-redirect.html",
  "url" : "/api-docs/xxx/v1/openapi.yml",
  "validatorUrl" : ""
}

To Reproduce

We are using springoc-openapi-ui 1.5.12 with Spring 5.3.13, with the following configuration:

springdoc:
  # We don't use SpringDoc to auto-generate an OpenAPI spec from our source code.
  # Rather, we use our manually defined spec from src/main/resources/static/api-docs/xxx/v1/openapi.yml.
  api-docs:
    enabled: false
    path: /api-docs
  swagger-ui:
    disable-swagger-default-url: true
    url: /api-docs/xxx/v1/openapi.yml

Expected behavior

The /api-docs/swagger-config endpoint should return the following (correct configUrl):

{
  "configUrl" : "/api-docs/swagger-config",
  "oauth2RedirectUrl" : "http://localhost:8080/swagger-ui/oauth2-redirect.html",
  "url" : "/api-docs/xxx/v1/openapi.yml",
  "validatorUrl" : ""
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions