question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Large response bodies cause hanging

See original GitHub issue
Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.4.0
How did you install Swagger-UI? local dev server
Which browser & version? Chrome 61
Which operating system? macOS High Sierra

Demonstration API definition

Swagger 2 Petstore is sufficient.

Configuration (browser query string, constructor, config.yaml)

Default.

Current Behavior

As an example, GET /pet/findByStatus in the Petstore currently returns 1.8MB of JSON when all statuses are selected. This is a pretty big chunk of data, but Swagger-UI insists on rendering the entire body, which is neither performant or useful. The main thread of the application is locked for upwards of 20 seconds on my machine.

Possible Solution

Truncate or refuse to display large textual response bodies.

Context

GET /pet/findByStatus is my favorite operation to use when testing UI enums, so this is something that impedes me pretty regularly.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:15
  • Comments:53 (20 by maintainers)

github_iconTop GitHub Comments

26reactions
lsanderscommented, Sep 24, 2020

Ran into this recently too. Looks like you can turn it off via config. For me, this worked:

SwaggerUI({
        syntaxHighlight: {
          activated: false,
          theme: "agate"
        },
        //url: path,
        ....
      });
14reactions
spyro2000commented, Dec 6, 2021
  1. Years. Later. Still the same problem and no flag available to disable pretty print… 😦
Read more comments on GitHub >

github_iconTop Results From Across the Web

swagger-ui hangs on big responses - Stack Overflow
One of my endpoints returns a JSON (not huge, around 2MB). Trying to run GET on this endpoint in swagger-ui results in the...
Read more >
Swagger hangs and never returns data from query - TMS XData
Hello I have a problem with a request that never finishes and returns data. When I use the REST debugger in Delphi it...
Read more >
swagger UI hanging - Google Groups
Hi people, I've just found that some of my calls through the swagger UI now hang the web page. I get a "Warning:...
Read more >
swagger ui freezing in expanding POST or PUT method
but its impossible for us to change application structure . Is there any solution to solve this issue without big changes in project....
Read more >
jmeter GUI hangs when viewing Big JSON body with no space
One of these requests' responses is huge (~7 MB), i think that's the reason of the freeze. I thought it was caused by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found