json-gate
json-gate copied to clipboard
by default createSchema should not throw an error if default value does not match type
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.