You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used with (e.g. hapi application, another framework, standalone, ...): standalone
What are you trying to achieve or the steps to reproduce?
constJoi=require('joi');Joi.string().case();// Uncaught Error: Invalid caseJoi.string().min();// Doesn't throw!const{ error }=Joi.string().min().validate('foo');console.log(error.toString());// ValidationError: "value" length must be at least characters long
As you can see some methods that take a required argument don't throw at schema-build time, and you get a more cryptic error at validation time instead. These methods include:
number.greater/less/max/min/multiple
string.length/max/min
There are probably others.
I ran into this while trying to upgrade my v15 extensions to to the new format and trying to make sense of the behaviour when the arg assert property is specified, see here for more details: #2470 (comment)
The text was updated successfully, but these errors were encountered:
Context
What are you trying to achieve or the steps to reproduce?
As you can see some methods that take a required argument don't throw at schema-build time, and you get a more cryptic error at validation time instead. These methods include:
number.greater/less/max/min/multiple
string.length/max/min
There are probably others.
I ran into this while trying to upgrade my v15 extensions to to the new format and trying to make sense of the behaviour when the arg
assert
property is specified, see here for more details: #2470 (comment)The text was updated successfully, but these errors were encountered: