-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
allow param defaults to be set by the param validations #1103
allow param defaults to be set by the param validations #1103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
lib/index.js
Outdated
@@ -298,7 +298,11 @@ internals.root = function () { | |||
} | |||
|
|||
if (validateArgs) { | |||
joi.assert(arg, validateArgs); | |||
const res = joi.validate(arg, validateArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you replace with arg = joi.attempt(arg, validateArgs)
?
Maybe you'd rather I use |
What do you mean not being hit ? The coverage is still 100%. |
I needed to add a few expects to cause the |
Ah ok, then you reached a better coverage, that's great. |
Thanks for the quick turn around and all of your hard work! :-) |
It's published. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
I found it surprising while making an extension that the defaults I set in the params validation weren't being applied.