Skip to content

CONFIG file with urls array doesn't work starting with v3.19.5 #5068

@CameronGo

Description

@CameronGo

Q&A (please complete the following information)

Browser is Chrome.
Running swagger UI using Docker image. v3.19.4 works, v3.19.5 - v3.20.2 is broken.

Content & configuration

{
    "dom_id": "#swagger-ui",
    "deepLinking": true,
    "docExpansion": "none",
    "urls": [
        {
            "name": "v2",
            "url": "https://URL/v2/openapi.yaml"
        },
        {
            "name": "v3",
            "url": "https://URL/v3/openapi.yaml"
        }
    ]
}

Example Swagger/OpenAPI definition:
N/A

Describe the bug you're encountering

Starting with v3.19.0 using the CONFIG_URL you could reference a config.json file, which had an array of urls to return different API spec documents. This worked as recently as v3.19.4, but starting with v3.19.5 this behavior is broken and appears to be the case with the latest v3.20.2 versions as well.

When you use the same config with these newer versions, Swagger UI comes up, the config is retrieved (I can tell b/c of the visual changes related to docExpansion, etc) but the API spec that is loaded is the default Petstore.

With further testing I determined that, if I create multiple items in the config.json urls array, the inital page load returns Petstore, but I can select another spec from the menu and this loads the correct API spec at which point I can toggle back and forth and the correct API spec is loaded.

To reproduce...

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions