Open chrisinmtown opened 3 years ago
Hope this is the right issue tracker. Please advise if this is a doc problem (not software problem) in which case prolly I should have created an issue here instead: https://github.com/swagger-api/swagger.io/issues
Hi @chrisinmtown yes it's the right issue tracker.
We have to first determine if the problem is in swagger-ui or in swagger-client which actually executes requests for swagger-ui.
We started to use new library for form data lately, so this might be related with it.
I encountered similar issue where I reckon reason is performed JSON.stringify on the JSON object and as result the form field is supplied with string and not object. That causes validation failure and 400 as result from connexion. Check my reported issue https://github.com/swagger-api/swagger-ui/issues/7625
I had the same issue. But put extra information in the encoding section:
encoding:
profileImage:
contentType: image/png, image/jpeg
address:
contentType: application/json
Fix the issue
Using Python3.8, flask 1.1.4, connexion 2.9.0 and swagger-ui-bundle 0.0.9 I cannot make the example work from https://swagger.io/docs/specification/describing-request-body/multipart-requests/ and I pasted that spec below. Please forgive if this is a dupe, I searched other open issues for multipart but didn't spot an exact match to this behavior.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition -- exactly the spec from the Swagger web site, URL above
Swagger-UI configuration options: (none)
Describe the bug you're encountering
The multipart form is not uploaded as I expect. I click "Try it out" in the UI, put in valid data. The window shows this cURL command:
But an error comes back:
The server logs this error:
To reproduce...
Steps to reproduce the behavior:
Expected behavior
I was hoping the documentation example would work :)