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

OpenAPI 3.1.0 support: bug in JSON Schema 2020-12 hasKeyword function #8686

Closed
char0n opened this issue May 19, 2023 · 0 comments
Closed

OpenAPI 3.1.0 support: bug in JSON Schema 2020-12 hasKeyword function #8686

char0n opened this issue May 19, 2023 · 0 comments

Comments

@char0n
Copy link
Member

char0n commented May 19, 2023

This is related to hasKeyword function. The body of the function needs to change from

typeof schema === "object" && Object.hasOwn(schema, keyword)

To

schema !== null && typeof schema === "object" && Object.hasOwn(schema, keyword)

Explanation: typeof null returns "object" and Object.hasOwn will throw if null is passed as first argument.

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

No branches or pull requests

1 participant