Make it possible to send JSON payloads instead of URL query strings
| Q | A |
|---|---|
| Bug or feature request? | request |
| Which Swagger/OpenAPI version? | 3.0 |
| Which Swagger-UI version? | 3.0.21 |
| How did you install Swagger-UI? | Node.js |
| Which browser & version? | Firefox 55 |
| Which operating system? | Linux |
Expected Behavior
Make it possible for the UI to send something like {"key1": "value", "key2": "value"} in a POST request to an API endpoint.
Current Behavior
Right now, you can only send something like key1=value&key2=value in the body, unless I'm missing something.
Possible Solution
Some sort of config parameter.
ui = new SwaggerUIBundle({
...
payloadType: 'json'
...
});
@joshtwo, this is possible 😄 see the addPet operation in the Petstore for an example: http://petstore.swagger.io/#/pet/addPet
This is clearly an issue with my API then, sorry about that. I see what's going on here; I don't have the "consumes" options set at all in the swagger.json I generate.
No worries @joshtwo! Did the consumes option get you what you wanted in your operation?
Closing due to inactivity.
This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.