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

Treat undefined properties as if they don't exist #220

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

polpo
Copy link

@polpo polpo commented Oct 22, 2015

This is an issue that arises when validating JS objects rather than objects that have come straight from JSON. Properties that are undefined should be treated as if they had undergone a JSON stringify/parse roundtrip: they should be considered invisible when doing validation. This matches the behavior of other JSON Schema validators that I have tested.

I understand if you disagree with this stance. Perhaps you wish to treat data that would not be expressible as JSON as not being valid.

This is an issue that arises when validating JS objects rather than objects
that have come straight from JSON. Properties that are undefined should be
treated as if they had undergone a JSON stringify/parse roundtrip: they should
be considered invisible when doing validation. This matches the behavior of
other JSON Schema validators that I have tested.
@polpo
Copy link
Author

polpo commented Oct 22, 2015

I just realized that this is a dupe of #175.

@drom
Copy link

drom commented Apr 28, 2017

@geraintluff this is important fix. Could you please merge it?

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