Skip to content

Url sanitization generates invalid OAS link #10544

@eceric31

Description

@eceric31

Q&A (please complete the following information)

  • OS: Windows 11
  • Browser: Chrome
  • Version: 138.0.7204.184
  • Method of installation: included as a dependency to Springdoc
  • Swagger-UI version: 5.21.0
  • Swagger/OpenAPI version: Swagger 2.0, OpenAPI 3.0

Content & configuration

The "../doc" link on the Swagger-UI page leads to "http:/server:port/app-index/api/swagger-ui/doc" instead of "http:/server:port/app-index/api/doc".

Swagger/OpenAPI definition:

springdoc.api-docs.path=/api/doc
springdoc.override-with-generic-response=false
springdoc.auto-tag-classes=false
springdoc.paths-to-match=/api/**
springdoc.use-fqn=true
springdoc.api-docs.version=OPENAPI_3_0

Swagger-UI configuration options:

springdoc.swagger-ui.path=/api/swagger-ui.html
springdoc.swagger-ui.configUrl=../doc/swagger-config
springdoc.swagger-ui.url=../doc
springdoc.swagger-ui.disable-swagger-default-url=true
springdoc.swagger-ui.filter=true
springdoc.swagger-ui.layout=BaseLayout
springdoc.swagger-ui.operationsSorter=alpha
springdoc.swagger-ui.validatorUrl=
springdoc.swagger-ui.displayOperationId=
springdoc.swagger-ui.deepLinking=true
springdoc.swagger-ui.defaultModelExpandDepth=5
springdoc.swagger-ui.defaultModelsExpandDepth=-1
springdoc.swagger-ui.docExpansion=none
springdoc.swagger-ui.use-root-path=false

Screenshots

Current state:

Image

Expected (old) state.

Image

How can we help?

Hi!

So my issue is that I've upgraded springdoc-openapi-starter-webmvc-ui to the latest stable version as of the time of writing this text (v2.8.9). This pulls in the swagger-ui v5.21.0 as a dependency, which results in the (above) described behavior. I've mitigated this by overriding the swagger-ui dependency to a version < 5.20.0. However, the new behavior would prevent me from ever moving to newer versions of swagger-ui.

Do you have any advice for a more permanent fix, or would you be able to add a "switch" that would regulate url sanitization behavior?

Best regards

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