-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
I propose we add any.message() type to allow to define custom language on a granular level as such:
Joi.string()
.min( 2 )
.message("must be at least 2 letters long")
.max( 255 )
.message("must be up least 255 letters long")
.regex(/somePattern/)
.message("must consist of only this and that...")
.regex(/someForbiddenPattern/, { invert: true })
.message("must not contain something...")
.regex(/someOtherForbiddenPattern/, { invert: true })
.message("must not contain somethign else...")
Currently, it's either super inconvenient to define via .options({ language: { .... } }), or, such is in this case, impossible (AFAIK) due to multiple .regex types using the same language.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement