swagger-api / swagger-api/swagger-ui

Swagger UI is ignoring OpenAPI-spec query parameter

Open
#8,041 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Hi,
I am having the issue that when deploying the swagger ui with multiple OpenAPI-specs (so that you need the dropdown menu on the top to select the spec) the query parameter marking the selection in the address bar is totally ignored. The API specs load perfectly and also reflect the selected spec in the address, but when I reload the page the viewer switches back to the first API spec, even though the address bar still indicates another spec should be displayed. Also sharing links to a specific spec does not work due to the issue, however the URL hash works correctly so that the viewer jumps to the right operation of a spec after reload

This issue occurs with the latest docker image, setting the list of loadable specs with a config file URL.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Swagger UI using a config file URL with multiple OpenAPI specs. Reload a URL containing the selected spec query parameter and compare it with the working URL-hash behavior. Done means the selected spec remains displayed after reload and links to that spec open it directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.