Joi package Version: ^17.6.0
I'm trying to get the error of the array of object keys. Reference Image of Joi Validation:
Json Data:
In this picture, I'm validating most of the fields using Joi, However when I try to validate an array of objects then I get the locations array message. Though, The empty or required is in items of the array.
How can I solve this?
You need to use array.min(1)
validation to specify that at least 1 item is required. Also there doesn't seem to be any array.empty
error so you need to use array.min
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.