swagger-api / swagger-api/swagger-ui

Browser hangs/runs out of memory for large request/response model schema

Open
#5,344 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: Windows10
  • Browser: Firefox
  • Version: 66
  • Method of installation: dist assets
  • Swagger-UI version: 3.10
  • Swagger/OpenAPI version: Swagger 2.0
Screenshots

OpenAPI_OutOfMemory

How can we help?

I am working on Enterprise application, APIs have very large set of Model schema. I have generated Swagger JSON using SpringFox, API response object has number of fields like CreatedDate, ModifiedDate etc. and these fields again some Object, for example Calendar object in this example. Same for other attributes/fields like ModifiedBy, Owner etc. those attributes again refer to some XYZObject.
These properties again present in nested objects( response object contains some inner object). Ultimately this creates very huge response body i.e. 'Example Value'/Model( In my case one of the API response object's example value is more than ~3 Lakhs lines, which is not really useful to user).
Browser runs OutOfMemory.

How to solve such issue?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in Swagger UI with the large nested Swagger 2.0 response schema described in the report, focusing on the Example Value and Model views. The work is complete when the browser no longer hangs or runs out of memory while displaying a similarly large schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.