Swagger-ui: urls.primaryName doesn't work as expected

Created on 12 Dec 2018  路  4Comments  路  Source: swagger-api/swagger-ui

Q&A

  • OS: macOS
  • Browser: chrome
  • Version: 71
  • Method of installation: dist assets
  • Swagger-UI version: 3.20.1
  • Swagger/OpenAPI version: Swagger 2.0

Content & configuration

Swagger-UI configuration options:

SwaggerUI({
        configUrl: document.location.origin + '/swagger-config.yaml',
        dom_id: '#swagger-ui',
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl,
          SwaggerUIBundle.plugins.Topbar
        ],
        operationsSorter: "alpha",
        tagsSorter: "alpha",
        layout: "StandaloneLayout",
        validatorUrl: null
})

swagger-config.yaml

urls:
  - name: common
    url: /api/common/index.json
  - name: v1
    url: /api/v1/index.json
  - name: v2
    url: /api/v2/index.yaml
urls.primaryName: v1

Describe the bug you're encountering


TopBar display correctly with urls.primaryName matched spec in the dropdown list, URL include ?urls.primaryName=v1 in the address bar of browser, but only the first spec of urls list will be loaded, not v1.

Expected behavior


With urls.primaryName option, Swagger-UI should process the matched spec name. So the v1 spec should be loaded when visit the UI initial page.

P1 lock-bot bug

All 4 comments

I'm seeing this as well, it seems to be introduced with 3.20.0. 3.19.5 works as expected with urls.primaryName.

Confirmed! Prioritizing this bug.

Looks like this was caused by aec4e37.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lmprice picture lmprice  路  104Comments

grosch picture grosch  路  75Comments

peter004 picture peter004  路  49Comments

marlandy picture marlandy  路  53Comments

azamatsulaiman picture azamatsulaiman  路  34Comments