Skip to Content
Docs

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 Native Object 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).

String Values

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

ValidationUI Input TypeUI Validation Feedback
"minLength": 2
minimum number of characters allowed
Input FieldOn change, prevents form submission
"maxLength": 64
maximum number of characters allowed
Input FieldOn change, prevents form submission
"format": "date-time"
e.g. 2029-11-13T20:20:39+00:00
Date+Time PickerOnly valid input allowed using picker
"format": "time"
e.g. 20:20:39+00:00
Time PickerOnly valid input allowed using picker
"format": "date"
e.g. 2029-11-13
Date PickerOnly valid input allowed using picker
"format": "email"
e.g. support@contextual.io
Input FieldOn submission/processing, validation error returned
"format": "uri"
e.g. https://contextual.io
Input FieldOn submission/processing, validation error returned
"format": "ipv6"
designate ipv4 or ipv6 as appropriate
Input FieldOn submission/processing, validation error returned
"pattern": "^[a-zA-Z0-9]+$"
string value must match the specified regular expression
Input FieldOn change, prevents form submission

Numeric Values

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

ValidationUI Input TypeUI Validation Feedback
"minimum": 3
specifies the minimum numeric value
Input FieldOn submission/processing, validation error returned
"exclusiveMinimum": "true"
excludes the minimum value itself
Input FieldOn submission/processing, validation error returned
"maximum": 999
specifies the maximum numeric value
Input FieldOn submission/processing, validation error returned
"exclusiveMaximum": "true"
excludes the maximum value itself
Input FieldOn submission/processing, validation error returned
"multipleOf": 5
allows only values that are divisible by the specified numeric value
Input FieldOn submission/processing, validation error returned

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