Large response bodies cause hanging
See original GitHub issueQ | 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:
- Created 6 years ago
- Reactions:15
- Comments:53 (20 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ran into this recently too. Looks like you can turn it off via config. For me, this worked: