swagger-api / swagger-api/swagger-ui
Large response bodies cause hanging
@glowcloud is already working on this.
Since Mar 5, 2024.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
| 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.