Request body only allows 'application/json'
See original GitHub issueCurrently we only allow request bodies with media type application/json
I would like to use application/x-www-form-urlencoded
. Unfortunately these are still quite common, including in the OAuth spec.
application/json
is hard-coded here:
https://github.com/asteasolutions/zod-to-openapi/blob/5fc40ede62ec4891a899469d941f20eb11ea26a2/src/openapi-generator.ts#L423-L425
I’m not sure how to modify the existing openapi extension to stay consistent with the current design.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Describing Request Body - Swagger
OpenAPI 3.0 provides the requestBody keyword to describe request bodies. ... (such as application/json ) and specifies the schema for each media type....
Read more >PUT request body as application/json instead of plain/text
I'm trying to send my body as content-type application/json but it keeps sending as text/plain. If I add the header "Content-Type" : " ......
Read more >Add a Request Body to a POST Request | API Connector
This article describes how to add a request body to a POST , PUT , or PATCH request using the API Connector extension...
Read more >Request Body - FastAPI
Use None to make it just optional. For example, this model above declares a JSON " object " (or Python dict ) like:....
Read more >Response codes - The REST API basics - Akeneo API
As JSON format is expected in all POST and PATCH requests, you will get this error response when your JSON body is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This feature should now be available as part of the v2.0.0 release.
Perhaps it would make sense to modify the current request implementation of body to more closely match the spec of multiple request bodies keyed by content type.