You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm trying to set a custom error message for a required field, but always show the default message. For example:
message ""password" is not allowed to be empty"
Bellow you can see the schema.
exportconstloginValidator=Joi.object({email: Joi.string().email({tlds: {allow: false}}).message('"Email" inválido.').required(),password: Joi.string().min(6).required().messages({'string.min': 'Password deve conter pelo menos 4 caracteres','any.required': 'Informe o password'})})
The custom message set to 'string.min' is working as expected, but 'any.required' not.
The text was updated successfully, but these errors were encountered:
Runtime
node
Runtime version
18.19.0
Module version
17.12.2
Used with
React TS
Any other relevant information
No response
How can we help?
Hello!
I'm trying to set a custom error message for a required field, but always show the default message. For example:
message ""password" is not allowed to be empty"
Bellow you can see the schema.
The custom message set to 'string.min' is working as expected, but 'any.required' not.
The text was updated successfully, but these errors were encountered: