swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

[develop 2.0] File upload not working in 2.0

Open mkrouwer opened this issue 12 years ago • 6 comments

File upload is not working in 2.0, it comes back with a javascript error

mkrouwer avatar Sep 23 '14 20:09 mkrouwer

Hi, can you please pull from the develop branch and try it out? Made some updates in the JS library to address this issue. Thanks!

fehguy avatar Dec 31 '14 22:12 fehguy

This change resolves my original issue, but I've encountered another.

Now when I click 'Try it out!', I get a JavaScript error on l. 753 of swagger-client.js: 'Uncaught TypeError: Cannot read property 'api' of undefined'.

Thanks.

edwardpig avatar Jan 02 '15 16:01 edwardpig

this has been fixed in the develop_2.0 branch

fehguy avatar Jan 31 '15 22:01 fehguy

Is there a test sample for using multipart/form-data and single file upload that the Swagger UI user can specify the content-type for the file contents? I am having trouble specifying this in Swagger 2.0 in a way that generates the correct request.

stevendearborn avatar May 05 '16 13:05 stevendearborn

@stevendearborn the spec doesn't allow specifying a content type for specific form data parameters. It's a limitation of the spec.

webron avatar May 05 '16 21:05 webron

I have seen screen captures of this working with Swagger 1.2, where Swagger UI paces a content-type drop-down box next to the file upload command button. Is this still possible in Swagger 2.0? Does anyone have a Swagger 2.0 example that works in Swagger UI?

stevendearborn avatar May 06 '16 19:05 stevendearborn