We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const schema = Joi.number().empty(5).default(5); const res1 = Joi.validate({ Test: 5 }, { Test: schema }, { noDefaults: false }); const res2 = Joi.validate({ Test: 5 }, { Test: schema }, { noDefaults: true });
res1.Test === 5 res2.Test === 5
res1.Test === 5 res2.Test === undefined
Hello ! i'm able to it work by changing L450 of lib/any.js from :
else if (options.noDefaults) { finalValue = originalValue; }
to:
else if (options.noDefaults) { finalValue = value; }
not sure it didn't break something else in the process tho... ?
The text was updated successfully, but these errors were encountered:
09616ac
Thanks ! Good spot !
Sorry, something went wrong.
Marsup
No branches or pull requests
Context
What are you trying to achieve or the steps to reproduce ?
Which result you had ?
res1.Test === 5
res2.Test === 5
What did you expect ?
res1.Test === 5
res2.Test === undefined
Hello ! i'm able to it work by changing L450 of lib/any.js from :
to:
not sure it didn't break something else in the process tho... ?
The text was updated successfully, but these errors were encountered: