swagger-api / swagger-api/swagger-ui
Generate a link to download a file rather than automatically downloading it
Open
Nobody has claimed this yet.
type: support
- 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: Fedora
- Browser: Firefox
- Version: Latest
- Method of installation: standalone dist
- Swagger-UI version: latest (3.28.0)
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
N/A
Screenshots
N/A
How can we help?
Considering an API that returns a stream of data (XML or JSON) as a file Content-disposition: attachment;filename=xxx.json.
We would like Swagger to generate:
- the cURL command ✔️
- the request URL ✔️
- and a "download" button but we would like Swagger to NOT actually do the call automatically because the file is big (potentially hundreds of MB) and it makes the Swagger UI freeze ❎ , OR just keep the execute but download the file through the browser native mechanism (asking for "save vs open..")
Is it something possible?
Thank you for any response :)
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.
Research direction
Start by reproducing the behavior in the standalone distribution using Firefox and an API endpoint returning a large XML or JSON attachment. Trace the Swagger UI execute and download behavior, then verify that the request URL and cURL command remain available without freezing the interface or automatically downloading the large file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100