Whitelists a value
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Requires the string value to only contain a-z, A-Z, and 0-9.
Returns a new type that is the result of adding the rules of one type to another.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Sets a default value if the original value is undefined.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Annotates the key
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Requires the string value to be a valid email address.
Annotates the key with an example value, must be valid.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Marks a key as forbidden which will not allow any value except undefined. Used to explicitly forbid keys.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Requires the string value to be a valid GUID.
Allows the value to match any whitelist of blacklist item in a case insensitive comparison.
Blacklists a value
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Requires the string value to be in valid ISO 8601 date format.
Specifies the exact string length required
Requires the string value to be all lowercase. If the validation convert option is on (enabled by default), the string will be forced to lowercase.
Specifies the maximum number of string characters.
Attaches metadata to the key.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Specifies the minimum number string characters.
Annotates the key
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Marks a key as optional which will allow undefined as values. Used to annotate the schema for readability as all keys are optional by default.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Overrides the global validate() options for the current key and any sub-key.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Defines a regular expression rule.
Marks a key as required which will not allow undefined as value. All keys are optional by default.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Sets the options.convert options to false which prevent type casting for the current key and any child keys.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Annotates the key
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Requires the string value to only contain a-z, A-Z, 0-9, and underscore _.
Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed.
Annotates the key with an unit name.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Requires the string value to be all uppercase. If the validation convert option is on (enabled by default), the string will be forced to uppercase.
Adds the provided values into the allowed whitelist and marks them as the only valid values allowed.
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
T in 'joi'.AnySchema<T extends AnySchema<Schema>>
Converts the type into an alternatives type where the conditions are merged into the type definition where: