Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser crashes while formatting large json response #1184

Closed
TroyMass opened this issue Apr 19, 2015 · 3 comments
Closed

Browser crashes while formatting large json response #1184

TroyMass opened this issue Apr 19, 2015 · 3 comments

Comments

@TroyMass
Copy link

When an API response is returned that contains >500 kB of unformatted json, the browser will occasionally/frequently crash while trying to pretty format it for display.

Possible solutions:

  1. Do not format json at all if response is larger than a threshold, instead display the unformatted version
  2. Truncate the response and format only the first N kB of it. Print a warning to indicate that the response was too large and truncated. Perhaps even add a way to view the raw in a new tab
@webron
Copy link
Contributor

webron commented Apr 19, 2015

@MassTroy - Thank you for the suggestion, but I believe this is exactly what the highlightSizeThreshold parameter for SwaggerUi does - https://github.com/swagger-api/swagger-ui#parameters.

@webron
Copy link
Contributor

webron commented May 4, 2015

@MassTroy - did you get a chance to test it?

@fehguy
Copy link
Contributor

fehguy commented May 8, 2015

@webron we should set a sensible default for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants