feat: drop nullable const support #520
Closed
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.
❗BREAKING CHANGES
I didn't check it here #511 but turns out if the schema has const property, it can't be nullable.
If I have a schema like that:
or
it will validate the
null
value as false. That means if we serialize thenull
value asnull
, the serialized object would fail the validation.P.S. I was confused because I saw the validation check, but it turns out that
is-my-json-valid
doesn't handleconst
check at all.fast-json-stringify/test/const.test.js
Line 242 in ab900c8