joi messages for any.required

node v18.11.0
version: 1.0.0
endpointsharetweet
var Joi = require("joi") const schema = Joi.object({ password: Joi.string() .min(6) .required() .messages({ 'string.min': 'Password deve conter pelo menos 4 caracteres', 'any.required': 'Informe o password' }) }) console.log(schema.validate({ }))
Loading…

no comments

    sign in to comment