It seems pretty straight forward to validate user\'s input in Node.js RESTapi with Joi.
But the problem is that my app is not written in English. That m
In the latest version use message as.
var schema = Joi.object().keys({
firstName: Joi.string().min(5).max(10).required().messages({
"string.base": `"username" should be a type of 'text'`,
"string.empty": `"username" cannot be an empty field`,
"any.required": `"username" is a required.`,
}),
lastName: Joi.string().min(5).max(10).required().messages({
"string.base": `"lastName" should be a type of 'text'`,
"string.empty": `"lastName" cannot be an empty field`,
"any.required": `"lastName" is a required.`,
}),
[...]
});