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

Should not accept an optional property with value null (unless null type) #35

Merged
merged 1 commit into from
Nov 13, 2015

Conversation

cburgmer
Copy link

It is my understanding that null values should be invalid, unless the null type is allowed. This matches (failing) examples like {"type": "string"} with null on http://jsonschemalint.com/draft4/.

However currently

user=> (schema/validate {:type "string"} nil)
true

This commit changes the behaviour to disallow null, removing code previously allowing null of the property was optional (maybe as specified in an older draft?).

I have only added tests for string and integer types so far.

@jaor jaor merged commit b44cd6d into bigmlcom:master Nov 13, 2015
@jaor
Copy link
Member

jaor commented Nov 13, 2015

Looks good to me: merged!

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.

None yet

2 participants