json-gate icon indicating copy to clipboard operation
json-gate copied to clipboard

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

Open oferei opened this issue 12 years ago • 0 comments

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.

oferei avatar Oct 19 '12 14:10 oferei