Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RuleOptions

Index

Properties

Properties

Optional keep

0.0.46 provide
keep: boolean

if 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

Optional message

0.0.46 provide
message: string | Record<string, string>

a 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.

Optional warn

0.0.46 provide
warn: boolean

if true, turns any error generated by the ruleset to warnings.