[validators.enum]
validators.enum is a slot in the validators namespace, in Hyperlambda, the language of Magic Cloud. Validates that a value or resolved expression result is one of the allowed options, throwing if validation fails.
- Value (
enum-value), required: Value or expression selecting the node or nodes to validate
Arguments
Required arguments come first, then the optional ones in the order they are declared.
| Argument | Type | Required | Description |
|---|---|---|---|
| unnamed child node | string | yes | Accepted enum value. Can be repeated. |
Guide: How to use [validators.enum]
JSON declaration
This is the complete declaration of validators.enum, as the running system describes it. It is also published as slot.json.
JSON declaration
{
"name": "validators.enum",
"description": "Validates that a value or resolved expression result is one of the allowed options, throwing if validation fails",
"signature": {
"input": {
"kind": "enum-value",
"description": "Value or expression selecting the node or nodes to validate",
"required": true,
"mode": "ValueOrExpression"
},
"children": [
{
"type": "string",
"kind": "enum-value",
"description": "Accepted enum value",
"required": true,
"mode": "ValueOrExpression",
"cardinality": "OneOrMore",
"role": "Option",
"projection": "Value"
}
]
}
}
← validators.email |
all validators.* slots |
validators.integer → |