question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request body only allows 'application/json'

See original GitHub issue

Currently 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:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
AGalabovcommented, Oct 3, 2022

This feature should now be available as part of the v2.0.0 release.

1reaction
ryan-marscommented, Sep 27, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found