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

Request body not marked as optional by default #897

Open
caoimhebyrne opened this issue Aug 19, 2024 · 0 comments
Open

Request body not marked as optional by default #897

caoimhebyrne opened this issue Aug 19, 2024 · 0 comments

Comments

@caoimhebyrne
Copy link

According to the swagger specification, request bodies are optional by default, i.e. if the required field doesn't exist, it should be inferred as false.

From my limited knowledge of the code, this seems to be doing the opposite, causing any requestBody without the required parameter to be inferred as required, even though it should not be.

required:
requestBody &&
(typeof requestBody.required === "undefined" || !!requestBody.required),

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