# Frequently Used Validation

### When does validation happen?

Validation based on your Object Type Data Schema is enforced as follows.

* Anytime a Record is created, updated or patched programmatically, either internally in your Contextual solution and its processing of data, or when an external system uses the Tenant API to interact with Object Type records
* When Records are created or updated using the Contextual Workspace UI, the forms that are presented to users for doing so perform a combination of client-side input validation with onChange user feedback (e.g. minLength, regular expression match), enforced data format entry using custom-rendered UI elements (e.g. Date+Time Pickers), and/or validation success or failure after submission of the form (e.g. ipv6).

Learn more about [JSON Schema Type-Specific Keywords (https://json-schema.org)](https://json-schema.org/understanding-json-schema/reference/type).

### String Values

These are common ways to validate `"type": string` values in your data schema. All validation and data requirements are enforced by your Tenant API

<table><thead><tr><th width="352">Validation</th><th width="153" align="center">UI Input Type</th><th>UI Validation Feedback</th></tr></thead><tbody><tr><td><code>"minLength": 2</code><br>minimum number of characters allowed</td><td align="center">Input Field</td><td>On change, prevents form submission</td></tr><tr><td><code>"maxLength": 64</code><br>maximum number of characters allowed</td><td align="center">Input Field</td><td>On change, prevents form submission</td></tr><tr><td><code>"format": "date-time"</code><br>e.g. 2029-11-13T20:20:39+00:00</td><td align="center">Date+Time Picker</td><td>Only valid input allowed using picker</td></tr><tr><td><code>"format": "time"</code><br>e.g. 20:20:39+00:00</td><td align="center">Time Picker</td><td>Only valid input allowed using picker</td></tr><tr><td><code>"format": "date"</code><br>e.g. 2029-11-13</td><td align="center">Date Picker</td><td>Only valid input allowed using picker</td></tr><tr><td><code>"format": "email"</code><br>e.g. support@contextual.io</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"format": "uri"</code><br>e.g. https://contextual.io</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"format": "ipv6"</code><br>designate ipv4 or ipv6 as appropriate</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"pattern": "^[a-zA-Z0-9]+$"</code><br>string value must match the specified regular expression</td><td align="center">Input Field</td><td>On change, prevents form submission</td></tr></tbody></table>

### Numeric Values

These are common ways to validate `"type": "number"` and `"type": "int"` numeric values in your data schema.

<table><thead><tr><th width="352">Validation</th><th width="153" align="center">UI Input Type</th><th>UI Validation Feedback</th></tr></thead><tbody><tr><td><code>"minimum": 3</code><br>specifies the minimum numeric value</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"exclusiveMinimum": "true"</code><br>excludes the minimum value itself</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"maximum": 999</code><br>specifies the maximum numeric value</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"exclusiveMaximum": "true"</code><br>excludes the maximum value itself</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr><tr><td><code>"multipleOf": 5</code><br>allows only values that are divisible by the specified numeric value</td><td align="center">Input Field</td><td>On submission/processing, validation error returned</td></tr></tbody></table>

### Boolean Value

These are common ways to validate `"type": "boolean"` values in your data schema.

* `"const": true` specifies either true or false value

### "type": "object"

* `code` note

### "type": "array"

* `code` note
