Skip to content

urls.primaryName doesn't work as expected #5075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lkebin opened this issue Dec 12, 2018 · 4 comments · Fixed by #5097
Closed

urls.primaryName doesn't work as expected #5075

lkebin opened this issue Dec 12, 2018 · 4 comments · Fixed by #5097

Comments

@lkebin
Copy link

lkebin commented Dec 12, 2018

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.

@havwig
Copy link

havwig commented Dec 18, 2018

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

@shockey
Copy link
Contributor

shockey commented Dec 21, 2018

Confirmed! Prioritizing this bug.

@shockey
Copy link
Contributor

shockey commented Dec 22, 2018

Looks like this was caused by aec4e37.

@lkebin
Copy link
Author

lkebin commented Dec 22, 2018

Thanks

@lock lock bot locked and limited conversation to collaborators Dec 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants