ruby-grape / ruby-grape/grape-swagger
File type param uses wrong name in both docs UI and when sending test request from docs.
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
Grape swagger is working brilliantly for all my endpoints apart from this one that requires a File param. The grape api endpoint works fine and all params validate when I call the api from my own code but the auto generated swagger docs are not working right with this one param. Here's the param validation code:
params :requires_pdf_data do
requires :data, type: Rack::Multipart::UploadedFile, desc: 'Mulitpart file upload accepts application/pdf'
end
And here's a screenshot of how swagger shows that param:

When I call the endpoint from my own code it works perfectly but from swagger it always says that the data param is missing. Is this a bug or am I missing something? Any ideas?
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 requires_pdf_data endpoint in the generated Swagger docs with its data multipart file parameter, then compare the parameter name shown in the docs UI with the name sent in the test request. Done means the docs UI and generated request send the correct name and the endpoint no longer reports the file parameter as missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100