Add required + null validation test#827
Merged
Merged
Conversation
gregsdennis
reviewed
Feb 4, 2026
Member
gregsdennis
left a comment
There was a problem hiding this comment.
I think this is good. Might as well add a boolean test while you're in here.
Just a comment on the description.
| "valid": true | ||
| }, | ||
| { | ||
| "description": "null is valid", |
Member
There was a problem hiding this comment.
I would say "ignores null" to stay in line with the other descriptions.
Contributor
Author
There was a problem hiding this comment.
Updated the description for consistency and added a boolean case alongside the existing non-object tests. Thanks!
jdesrosiers
requested changes
Feb 6, 2026
Member
jdesrosiers
left a comment
There was a problem hiding this comment.
Looks good. Please add the tests to draft-04, draft-06, and v1 as well.
Contributor
Author
Hi @jdesrosiers , i have added the tests to draft-04, draft-06, and v1 as well. |
jdesrosiers
approved these changes
Feb 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a minimal test case for the
requiredkeyword validating anullinstance.Per the specification,
requiredonly applies to object instances, sonullshould be considered valid. This test helps catch potential implementation bugs (e.g. treatingnullas an object in JavaScript).This change follows the discussion and approval in #821.