swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

Swagger-UI hangs when expanding operation

Open ogerardin opened this issue 3 months ago • 1 comments

Q&A (please complete the following information)

  • OS: Windows
  • Browser: Chrome
  • Version: 141
  • Method of installation: webjar
  • Swagger-UI version: 5.29.3
  • Swagger/OpenAPI version: OpenAPI 3.1

Content & configuration

We have a fairly large OpenAPI file (330 K) generated by springdoc-openapi, which I can't share for confidentiality reasons. The models are generated from complex Java classes that present indirect circular references.

No customization on the Swagger-UI side.

Describe the bug you're encountering

The Swagger-UI page loads normally (although slowly), but when expanding certain operations, the page becomes unresponsive until Chrome offers to kill it.

To reproduce...

Steps to reproduce the behavior:

  1. Load the Swagger-UI page
  2. Click on an operation to expand it
  3. page becomes unresponsive

Expected behavior

Obviously I expect the operation details to be displayed so I can interact with it, or a message that explains that there is an issue with my OpenAPI file, should it be the case.

Screenshots

View of the operation right after clicking on it: Image

Chrome tasks panel: Image

Additional context or thoughts

On a suggestion I checked "pause on exception" in the Chrome developer dev tools, I observe that the following two exceptions alternate.

Exception 1: Image

Exception 2 (with a different value of s each time) Image

I suspect the problem is related to the circular nature of the model, but I can't change it as it is part of a corporate shared library.

I've seen similar issues raised but not exactly the same, and none that offered a solution.

Thanks for any help.

ogerardin avatar Oct 24 '25 13:10 ogerardin

For what it's worth, the page also hangs if I expand some of the schemas at the bottom of the page.

ogerardin avatar Oct 24 '25 14:10 ogerardin