Skip to content

Passed url=../swagger.json, but the href of the link in UI become ./swagger.json, the first dot gets lost #10439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jjqq2013 opened this issue May 4, 2025 · 0 comments

Comments

@jjqq2013
Copy link

jjqq2013 commented May 4, 2025

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Version: 135.0.7049.115
  • Method of installation: dist assets
  • Swagger-UI version: 5.21.0
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

#Does not matter

Swagger-UI configuration options:

//Does not matter

Describe the bug you're encountering

Passing url=../swagger.json, but the link in UI become "ref=./swagger.json", the first dot gets lost!

To reproduce...

Steps to reproduce the behavior:

  • Just make the web server serve the ../swagger.json
  • In the Swagger UI, input ../swagger.json to the top text input field, then click the "Explore".

Expected behavior

  • The link "../swagger.json" is shown, and its href should be "../swagger.json", notes the 2 dots.

Screenshots

Image

Additional context or thoughts

Should be a bug of the sanitizeUrl function.

@jjqq2013 jjqq2013 changed the title Passing url=../swagger.json, but the link in UI become "ref=./swagger.json", the first dot gets lost Passed url=../swagger.json, but the link in UI become "href=./swagger.json", the first dot gets lost May 4, 2025
@jjqq2013 jjqq2013 changed the title Passed url=../swagger.json, but the link in UI become "href=./swagger.json", the first dot gets lost Passed url=../swagger.json, but the href of the link in UI become ./swagger.json, the first dot gets lost May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant