when true, error message templates will escape special characters to HTML entities, for security purposes. Defaultfalse
label?
false | "path" | "key"
defines the value used to set the label context variable.
language?
string
The preferred language code for error messages. The value is matched against keys at the root of the messages object, and then the error code as a child key of that. Can be a reference to the value, global context, or local context which is the root value passed to the validation function. Note that references to the value are usually not what you want as they move around the value structure relative to where the error happens. Instead, either use the global context, or the absolute value (e.g. Joi.ref('/variable'))
render?
boolean
when false, skips rendering error templates. Useful when error messages are generated elsewhere to save processing time. Defaulttrue
stack?
boolean
when true, the main error will possess a stack trace, otherwise it will be disabled. Defaults to false for performances reasons. Has no effect on platforms other than V8/node.js as it uses the Stack trace API. Defaultfalse
overrides the way values are wrapped (e.g. [] around arrays, "" around labels). Each key can be set to a string with one (same character before and after the value) or two characters (first character before and second character after), or false to disable wrapping.
wrap.array?
string | false
the characters used around array values. Defaults to '[]'Default'[]'
wrap.label?
string | false
the characters used around {#label} references. Defaults to '"'. Default'"'
wrap.string?
string | false
the characters used around array string values. Defaults to no wrapping. Defaultfalse