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

File Upload #47

Closed
reiz opened this issue Jun 30, 2013 · 5 comments
Closed

File Upload #47

reiz opened this issue Jun 30, 2013 · 5 comments

Comments

@reiz
Copy link

reiz commented Jun 30, 2013

One of the API Endpoints expects an file upload. The api works fine, but swagger-ui does not render an file upload. Instead of that it renders an input filed. What I have to do to get a file upload rendered?
Many Thanks in advance.

@timgluz
Copy link
Contributor

timgluz commented Jul 1, 2013

Actually, the solution is oneliner - Ruby uses Hash as file-class, and that's the reason why current matching value[:type] = 'file' if value.is_a?(Hash) && value[:type] == 'Rack::Multipart::UploadedFile'` doesnt work;

I pushed patch with updated matching; and it's shows uploading button as it should. https://github.com/tim-vandecasteele/grape-swagger/pull/48

@reiz
Copy link
Author

reiz commented Jul 1, 2013

Like!

@dblock
Copy link
Member

dblock commented Jul 14, 2014

Fyi, https://github.com/tim-vandecasteele/grape-swagger/pull/48 is still open and needs work.

@dblock
Copy link
Member

dblock commented Aug 17, 2014

Closed via tim-vandecasteele@04566fc.

@davetapley
Copy link
Contributor

Bad news, it appears has had some unintended consequences for #91.
See my comment here.

My theory: I believe this assertion that the type is 'File' is too aggressive, because value will also be a Hash in the case of nested params.

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

No branches or pull requests

4 participants