oferei / json-gate

A friendly, fast JSON schema validator
MIT License
100 stars 16 forks source link

by default createSchema should not throw an error if default value does not match type #8

Open oferei opened 12 years ago

oferei commented 12 years ago

By specs this should only be discovered when an object is validated, and then only if the default value is actually used (instance is undefined).

A "strict" option should be used when validating a schema which will perform additional checks on the schema which are not by specs. only in "strict" mode the createSchema function should check and throw. this includes checking default value.