-
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
Joi.array().items(...) error message changes #589
Comments
I had the same error earlier with the same thought. The error does say what is wrong (sort of) with the array (the value, the array, is missing a required item) but it would be nice to propagate deeper error messages. Saying If someone can point me in the right direction I might do a PR |
Required has a meaning now, remove it from that string and you'll get back your old message. |
Why does array not follow the same logic as |
👍 |
Thanks @Marsup 👍 |
Going through the new 6.0 release it looks like the error messages for Array items have actually gotten worse now. So instead of receiving an error such as:
value at position 0 fails because value length must be less than or equal to 5 characters long
assuming that we have a schema such as:Now when we have a schema such as:
The same array being validated which doesn't have the minimum 5 characters just results in an error stating
"value" does not contain 1 required value(s)
. Is there are particular constraint to the change toitems()
which resulted in these error messages being less useful or do the error messages just need to be enhanced?Thanks!
The text was updated successfully, but these errors were encountered: