Skip to content
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

3.30.1 breaks path tags (endpoints don’t expand) #6249

Closed
andrewminion-luminfire opened this issue Jul 21, 2020 · 11 comments · Fixed by fastapi/fastapi#1763 or #6255
Closed

3.30.1 breaks path tags (endpoints don’t expand) #6249

andrewminion-luminfire opened this issue Jul 21, 2020 · 11 comments · Fixed by fastapi/fastapi#1763 or #6255

Comments

@andrewminion-luminfire
Copy link

Q&A (please complete the following information)

  • OS: macOS
  • Browser: Chrome
  • Version: 84.0.4147.89
  • Method of installation: SwaggerUIBundle from unpkg
  • Swagger-UI version: 3.30.1
  • Swagger/OpenAPI version: OpenAPI 3.0.2

Content & configuration

Example Swagger/OpenAPI definition: example.yml

Swagger-UI configuration options:

SwaggerUIBundle({
    url: "openapi",
    dom_id: "#api-explorer",
    presets: [
        SwaggerUIBundle.presets.apis,
        SwaggerUIBundle.SwaggerUIStandalonePreset
    ],
})

Describe the bug you're encountering

When opening a path that is in a tag “group”, it disappears and then reappears underneath the default tag.

This is a regression in 3.30.1; I temporarily set my unpkg URL to 3.30.0 (https://unpkg.com/[email protected]/swagger-ui-bundle.js) and the behavior no longer happens. I set it back to 3 to get the latest version and it started happening again.

To reproduce...

Steps to reproduce the behavior:

  1. Go to a path in a tag “group”
  2. Click on the path item
  3. See error: the path item will disappear and reappear further down the page under a new default tag group.
  4. The path item under the default tag will sit and spin.

Expected behavior

The path item should open in place.

Screenshots

example

@raymondfeng
Copy link

@tim-lai This bug completely breaks the swagger-ui as the API Explorer. Please investigate. It would be nice to find out which version introduces the issue so that we can pin to another older version as the workaround. Thanks in advance!

@tiangolo
Copy link

You can temporarily pin to 3.30.0 as @andrewminion-luminfire explained.

@thusithaC
Copy link

Is there something we can do from the client (browser) side? Cant update deployed code without going through hoops.

@mavci
Copy link

mavci commented Jul 22, 2020

@thusithaC I think you can use raw yaml file to view in your local swagger ui with version 3.30.0

@NathanHazout
Copy link

I use swagger-ui-express, how do I prevent it from using the latest swagger-ui?

@e0
Copy link

e0 commented Jul 22, 2020

@nasht00 If you are using yarn, you can add the following to your package.json file and rebuild.

  "resolutions": {
    "swagger-ui-dist": "3.30.0"
  }

There is also this for npm but I haven't tried it myself.

@Kansukey
Copy link

We had exactly the same issue. That new version 3.30.1 is breaking the visualization of schemas, and the Authorize button is disappearing. I don't know if it can be useful, but by adding DOM breakpoint on the loaded documentation, we discovered that it's the React.JS dependency which is responsible of the button disappearing :

function removeChild(parentNode, childNode) {
  if (Array.isArray(childNode)) {
    var closingComment = childNode[1];
    childNode = childNode[0];
    removeDelimitedText(parentNode, childNode, closingComment);
    parentNode.removeChild(closingComment);
  }
  parentNode.removeChild(childNode);
}

Anyway, if you are dynamically loading the swagger-ui-bundle thanks to a CDN, you should specify the version 3.30.0 which is the last working version :

- https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js
+ https://unpkg.com/[email protected]/swagger-ui-bundle.js

Same thing if you're loading your dependencies by using package.json, you should replace ^3 or 3.* by 3.30.0.

@andrewminion-luminfire andrewminion-luminfire changed the title 3.30.1 breaks path tags 3.30.1 breaks path tags (endpoints don’t expand) Jul 22, 2020
@tim-lai
Copy link
Contributor

tim-lai commented Jul 22, 2020

@andrewminion-luminfire Thanks for reporting. I am investigating.

@tim-lai
Copy link
Contributor

tim-lai commented Jul 22, 2020

New release to resolve this issue, v3.30.2

@andrewminion-luminfire
Copy link
Author

Thanks @tim-lai !

@jmriebold
Copy link

@tim-lai, jsDelivr appears to still be serving 3.30.1 for version 3. Is this going to update automatically or does it require action on Swagger's part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet