swagger-ui
swagger-ui copied to clipboard
Swagger urls.primaryName not working
Q&A (please complete the following information)
- OS: Fedora 35
- Browser: Chrome
- Version: 97.0.4692.99
- Method of installation: docker
- Swagger-UI version: 4.5.0
- Swagger/OpenAPI version: OpenAPI 3.0.1
Content & configuration
Environment config:
env:
- name: URLS
value: '[{url: "http://example.com/openapi.json", name: "orch"}, {url: "https://dev.example.com/openapi.json", name: "orch-DEV-master"}, {url: "http://stable.example.com/openapi.json", name: "orch-DEV-stable-next"}, {url: "http://stage.example.com/openapi.json", name: "orch-STAGE"}]'
/?urls.primaryName=orch-DEV-master
Describe the bug you're encountering
The urls.primaryName parameter is ignored when accessing the page and "orch" definition is always shown. Once the page loads, switching to different definition by the dropdown works as expected.
To reproduce...
Steps to reproduce the behavior:
- Go to '
/?urls.primaryName=orch-DEV-master' - See that definition orch is selected
Expected behavior
The definition should be selected according to the parameter in URL.
Screenshots
Additional context or thoughts
Try add the parameter queryConfigEnabled: true
https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#core
That helped, but doesn't that allow overriding all configuration options? Isn't that risky?
That helped, but doesn't that allow overriding all configuration options? Isn't that risky?
See https://github.com/swagger-api/swagger-ui/security/advisories/GHSA-qrmm-w75w-3wpx
Any updates on this?
I think this is still an issue. You should be able to link to another internal definition without setting queryConfigEnabled: true
, which enables linking to content from other sites.