I just came across this line of code that I had to work on:
Joi.array().label('Emails').items(Joi.string()).required()
I particularly didn't understand what .label('Emails') was doing, so, I hit the documentation:
Overrides the key name in error messages.
name - the name of the key.const schema = { first_name: Joi.string().label('First Name') };
and this particularly didn't make any sense to me. Because, is First Name, Emails particular parameters that can be passed? What is it overriding? What other arguments can we pass, etc. What is this method doing particularly?