Skip to content

Joi.array().items(...) error message changes #589

@DavidTPate

Description

@DavidTPate

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:

var schema = Joi.array().includes(Joi.string().min(5).required());

Now when we have a schema such as:

var schema = Joi.array().items(Joi.string().min(5).required());

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 to items() which resulted in these error messages being less useful or do the error messages just need to be enhanced?

Thanks!

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions