Logo
NeoArc Studio

Validation Rules

Add validation to your schemas with comprehensive field-level and cross-field rules. Maintain data quality with custom messages and severity levels.

Validation rules verify that data meets requirements before processing. The schema editor includes comprehensive field-level and cross-field rules, covering everything from simple required checks to complex conditional validation.

Adding Validation Rules

General Rules

These rules apply to all field types.

RuleDescription
requiredField must be present
nullableAllow null values
constMust equal a specific value
enumValue must be in an allowed list
notEnumValue must not be in a forbidden list
formatMust match a specific format
typeMust match expected type
customCustom validation expression

String Rules

Validation rules specific to string fields.

The following schemas demonstrate pattern validation with custom error messages:

Numeric Rules

Validation rules for integer and number fields.

Boolean Rules

RuleDescription
requiredField must be present
mustBeTrueValue must be true
mustBeFalseValue must be false
constMust equal specific boolean value

Array Rules

RuleDescription
minItemsMinimum number of items
maxItemsMaximum number of items
uniqueItemsAll items must be unique
containsArray must contain specific value
allowEmptyWhether empty arrays are valid

Object Rules

RuleDescription
minPropertiesMinimum number of properties
maxPropertiesMaximum number of properties
requiredPropertySpecific property must exist
forbiddenPropertySpecific property must not exist
propertyPatternProperty names must match pattern
dependenciesProperty dependencies

Cross-Field Validation

Cross-field rules validate relationships between multiple fields. Add these in the Cross-Field Validation section of the schema editor.

Custom Error Messages

Each validation rule can have a custom error message with the following properties.

Validation Builder Modes

Next Steps

Schema Inheritance
Build on existing schemas
Learn more →
Getting Started with Schemas
Schema basics
Learn more →