-
Notifications
You must be signed in to change notification settings - Fork 20
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
coerce is a little over zealous #7
Comments
So undefined shouldn't be coerced? |
well, void 0 should probably, sure...but !key in object shouldn't be, if you know what i'm saying... it forces all keys to exist (even the required ones) and creates false positives in schema validation |
and shouldn't it be an opt-in? like, shouldn't you have to have a coerce: true member on your schema descriptor? |
Does this fix it? |
perfect...if you think it's better to coerce by default -- i guess it doesn't hurt in a postel kinda way, perhaps a "coerce" config setting would also be useful...just a thought, but this works for me |
it looks like the patching of json-schema's coerce is a little over zealous -- it will coerce for required values that don't actually have keys, which causes inserts that should fail to succeed with, for instance, an empty string
The text was updated successfully, but these errors were encountered: