Skip to content
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

Support application/x-www-url-encoded requestBody #5

Open
dbushong opened this issue Sep 5, 2023 · 0 comments
Open

Support application/x-www-url-encoded requestBody #5

dbushong opened this issue Sep 5, 2023 · 0 comments

Comments

@dbushong
Copy link
Member

dbushong commented Sep 5, 2023

See: https://spec.openapis.org/oas/v3.0.0#support-for-x-www-form-urlencoded-request-bodies

Currently they are sent as json POST bodies instead of properly form encoded.

Current code:

// prefer JSON if we can get it
let reqBodySchema = reqBody.content?.['application/json']?.schema;
// else fall back on first of whatever else is available
if (!reqBodySchema && reqBody.content) {
const mimeTypes = Object.keys(reqBody.content);
if (mimeTypes.length > 0) {
reqBodySchema = reqBody.content[mimeTypes[0]].schema;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant