Skip to content

Swagger UI resources are incorrectly mapped when using WebJar prefix or Swagger root path #3145

@jamesmissen

Description

@jamesmissen

Describe the bug

Issue #2969 and pull #2970 attempt to apply the same SpringDoc transformations to the SpringDoc resources under /webjars/**.

In addition, commit e3b4311 modifies the mappings for SpringDoc resources in WebFlux if the springdoc.webjars.prefix property is altered.

However, these changes have multiple issues:

To Reproduce
Steps to reproduce the behavior:

Expected behavior

  • The springdoc.webjars.prefix should not affect the normal (non-WebJar) mappings to the Swagger UI resources.

  • The behaviour of the WebJars prefix should be the same for WebFlux and WebMvc, as both map WebJar resources to /webjars/** by default (i.e. it's not specific to WebFlux only).

  • The properties spring.mvc.webjars-path-pattern and spring.webflux.webjars-path-pattern should be used instead of springdoc.webjars.prefix.

  • The /webjars/swagger-ui/** mapping should not be added if resource mappings at /webjars/** have been disabled (i.e. if spring.web.resources.add-mappings is set to false).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions