Skip to main content

Interface: BaseValidation

Basic capabilities for all validation types.

These are derived from the Yup Schema, only the validation-specific capabilities have been abstracted here.

Link

https://github.com/jquense/yup#table-of-contents

Hierarchy

Properties

defined

Optional defined: []


notOneOf

Optional notOneOf: [values: (null | string | number | boolean)[], message?: ValidationMessage]


notRequired

Optional notRequired: []


oneOf

Optional oneOf: [values: (null | string | number | boolean)[], message?: ValidationMessage]


optional

Optional optional: []


required

Optional required: [message?: ValidationMessage]


when

Optional when: [key: string, logic: RulesLogic<never>]

Adjust the validation based on a sibling or sibling children fields.

FIXME: The example is wrong -- when clauses are indexed by position, not by name.

Example

  {
"when": {
"key": "firstName",
"logic": {
{ "==": [{ "var": "firstName" }, "will"] },
{
"type": "result",
"required": "Last name is required when first name is Will"
},
{
"type": "result",
"notRequired": []
}
}
}
}
```;