Interface: WhenOptions<ThenSchema, OtherwiseSchema>
Type Parameters
| Type Parameter | Default type |
|---|---|
ThenSchema | any |
OtherwiseSchema | any |
Properties
| Property | Type | Description |
|---|---|---|
break? | boolean | whether to stop applying further conditions if the condition is true. |
is? | SchemaLike<any> | the required condition joi type. |
not? | SchemaLike<any> | the negative version of is (then and otherwise have reverse roles). |
otherwise? | SchemaLike<OtherwiseSchema> | the alternative schema type if the condition is false. Required if then or switch are missing. |
switch? | (SwitchCases | SwitchDefault)[] | the list of cases. Required if then is missing. Required if then or otherwise are missing. |
then? | SchemaLike<ThenSchema> | the alternative schema type if the condition is true. Required if otherwise or switch are missing. |