You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SwaggerUI({// this is the default configurationurl: "https://petstore.swagger.io/v2/swagger.json",dom_id: '#swagger-ui',deepLinking: true,presets: [SwaggerUIBundle.presets.apis,SwaggerUIStandalonePreset],plugins: [SwaggerUIBundle.plugins.DownloadUrl],layout: "StandaloneLayout"})
Query Parameter Swagger-UI Configuration:
?configUrl=/someUrl/swagger-config.json
Swagger-UI Configuration Endpoint Response Body:
{
"urls": "/someUrl/openapi.json"
}
Describe the bug you're encountering
The documentation states that the url parameter will be ignored if urls or spec is used. The UI has a race condition which causes it to load the pet store example even though the urls configuration parameter is provided.
To reproduce...
Steps to reproduce the behavior:
Open the Swagger-UI in a browser with the configUrl query parameter
Refresh the page to verify the Swagger-UI will load either the pet store example or the urls OpenAPI definition.
Expected behavior
Since the url configuration parameter is supposed to be ignored, the page should load with the first URL listed by the urls configuration parameter.
Additional context or thoughts
You can workaround this bug by providing a blank url configuration parameter in the configuration endpoint's response body:
{
"url": "",
"urls": "/someUrl/openapi.json"
}
The text was updated successfully, but these errors were encountered:
Q&A
Content & configuration
JavaScript Swagger-UI Configuration:
Query Parameter Swagger-UI Configuration:
Swagger-UI Configuration Endpoint Response Body:
Describe the bug you're encountering
The documentation states that the
url
parameter will be ignored ifurls
orspec
is used. The UI has a race condition which causes it to load the pet store example even though theurls
configuration parameter is provided.To reproduce...
Steps to reproduce the behavior:
configUrl
query parameterurls
OpenAPI definition.Expected behavior
Since the
url
configuration parameter is supposed to be ignored, the page should load with the first URL listed by theurls
configuration parameter.Additional context or thoughts
You can workaround this bug by providing a blank
url
configuration parameter in the configuration endpoint's response body:The text was updated successfully, but these errors were encountered: