Optional ReadonlymessageHuman-readable error message shown when the rule fails.
Optional ReadonlyparamsAdditional parameters for the validator. The shape depends on
the type:
| Type | Params |
|---|---|
| required | — |
| minLength | { min: number } |
| maxLength | { max: number } |
| min | { min: number } |
| max | { max: number } |
| pattern | { pattern: string } |
| — | |
| custom | { validatorId: string, … } |
ReadonlytypeThe validator to apply.
A single validation rule, JSON-serializable.
Example