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

Prevent crashing if no parameters defined in the schema #6

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

gimenete
Copy link
Contributor

In the OpenAPISchema interface the parameters attribute is optional / can be undefined. However there's an Object.entries(params) that fails in that case.

With this PR, params is always defined and Object.entries always succeeds.

Another option would've been to add an if statement. But this was the smallest change to make it work.

@gimenete
Copy link
Contributor Author

@G4brym
Copy link
Member

G4brym commented Nov 25, 2022

Yeah, I fixed that bug in the #5 branch, but I think your proposed fix is more clean

@G4brym G4brym merged commit 006658f into cloudflare:main Nov 25, 2022
@G4brym
Copy link
Member

G4brym commented Nov 25, 2022

I will bundle this fix with the next release when the request body validations are merged

@gimenete gimenete deleted the allow-undefined-parameters branch November 25, 2022 11:11
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

Successfully merging this pull request may close these issues.

2 participants