Skip to content

Interface: RuleOptions

Properties

PropertyTypeDescription
keep?booleanif true, the rules will not be replaced by the same unique rule later. For example, Joi.number().min(1).rule({ keep: true }).min(2) will keep both min() rules instead of the later rule overriding the first. Default false
message?string | LanguageMessagesa single message string or a messages object where each key is an error code and corresponding message string as value. The object is the same as the messages used as an option in any.validate(). The strings can be plain messages or a message template.
warn?booleanif true, turns any error generated by the ruleset to warnings.