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

How to stop large responses from rendering ? #3640

Closed
joaojeronimo opened this issue Sep 7, 2017 · 3 comments
Closed

How to stop large responses from rendering ? #3640

joaojeronimo opened this issue Sep 7, 2017 · 3 comments

Comments

@joaojeronimo
Copy link

joaojeronimo commented Sep 7, 2017

(this is swagger spec 2.0, swagger ui 3.0.17, I will upgrade in a bit and report back if anything changes)

I have an endpoint that delivers a very large JSON payload (about 46mb, sometimes more).

Obviously that can't be rendered on the browser, but swagger still attempts to and that crashes the browser tab.

Is there a way of forcing swagger to not render/format a response ?

I noticed that if I respond with a Content-Disposition: attachment and Content-Type: application/octet-stream swagger loads the whole response in a javascript Blob and renders a "Download file" link pointing to that blob's url, however I wouldn't want to change my API to satisfy swagger ui. Also, is this documented anywhere ? I could only find people on stack overflow mentioning it.

@webron
Copy link
Contributor

webron commented Sep 7, 2017

There's no way to control it right now, this would be a new feature.

@shockey
Copy link
Contributor

shockey commented Jun 26, 2018

Closing in favor of #4018, which covers most of this feature request, and has much more discussion around it.

Thanks @joaojeronimo!

@lock
Copy link

lock bot commented Jul 1, 2019

Locking due to inactivity.
This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.
If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.
Thanks!

@lock lock bot locked and limited conversation to collaborators Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants