Skip to content

webjars are not served from the expected url in webflux-ui with swagger-ui prefix path set #454

Closed
@maartenh

Description

@maartenh

Describe the bug
When I have a custom path /documentation/swagger-ui.html set for the webflux-ui version, this redirects to /documentation/webjars/swagger-ui/index.html?configUrl=/documentation/v3/api-docs/swagger-config
However, the webjars are not available on this url, leading to a 404 response.
The webjars are available on the alternative path /webjars/swagger-ui/index.html?configUrl=/documentation/v3/api-docs/swagger-config, ie without the /documentation prefix. That however foils my plan to have everything under the /documentation prefix for easier management of access permissions.

I tried also setting springdoc.webjars.prefix: /documentation/webjars, but that just compounded the issue by redirecting to /documentation/documentation/webjars/swagger-ui/index.html without changing the actual location the webjars were served from.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? v2.2.4
  • What modules and versions of springdoc-openapi are you using? springdoc-openapi-webflux-ui v1.2.32
springdoc.api-docs.path: /documentation/v3/api-docs
springdoc.swagger-ui.path: /documentation/swagger-ui.html
  • Access the path /documentation/swagger-ui.html from a web browser.
  • Observe 404 error

Expected behavior
The swagger ui is shown when accessing /documentation/swagger-ui.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions