-
Notifications
You must be signed in to change notification settings - Fork 9k
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
UI sends multipart content even though API specifies application/json #4981
Comments
Hey @dblock! It looks like your definition is describing all of your parameters as If you load your definition into Swagger Editor, you'll see a couple dozen errors that look like this:
Your POST /api/applications parameter currently looks like this: parameters:
- in: formData
name: name
description: Application name.
type: string
required: true If you want JSON, you should change For example: parameters:
- in: body
name: name
description: Application name.
required: true
schema:
type: object
properties:
name:
type: string This will give you a curl output that looks like this:
Hope this helps! |
Thanks. This is pretty clear. Now I have to figure out why we're defaulting primitive types into |
@dblock glad I could help! 😄 Note that I suggested using |
Right. I meant each field is a string, but the whole thing is an object. When monkey patched as in ruby-grape/grape-swagger#721 I get this and everything works. |
Coming from artsy/doppler#142 with swagger-ui version: 3.19.4.
API specification is https://api.artsy.net/api/docs, which has
and all APIs say
consumes
withapplication/json
.The "Try me" UI POSTs multipart data while specifying JSON in content type, resulting in an error from our API.
The curl code is incorrect too.
Reading the code ... is this because my fields have
in: "formData"
instead ofin: "body"
?That seems still weird. If the content type required is JSON, shouldn't everything be JSON?
The text was updated successfully, but these errors were encountered: