required

Validates that a particular function argument is not null, undefined, or an empty "" string.

Configuration

This rule type accepts the following parameters:

KeyTypeDefaultDescription
arg *stringThe name of the argument

Example

This validates that an argument called message is defined:

{
"type": "required",
"arg": "message"
}

You can also validate nested arguments, using dots to denote the path:

{
"type": "required",
"arg": "fields.message"
}