Skip to content

Validation Operators

Validation operators check that a value conforms to a specific format.

__email__ of **User** is a valid email
__email__ of **User** is not a valid email

Interactive Example

Policy Rule
Test Data (JSON)
__website__ of **Company** is a valid url

Interactive Example

Policy Rule
Test Data (JSON)
__id__ of **Record** is a valid uuid

Interactive Example

Policy Rule
Test Data (JSON)
__phone__ of **Contact** is a valid phone
__phone__ of **Contact** is a valid phone number

Interactive Example

Policy Rule
Test Data (JSON)
__birthday__ of **Person** is a valid date

Interactive Example

Policy Rule
Test Data (JSON)
__start_time__ of **Event** is a valid time
__created_at__ of **Record** is a valid datetime
__timestamp__ of **Log** is a valid iso8601

Interactive Example

Policy Rule
Test Data (JSON)

You can also use has the format or has format with a format name:

__email__ of **User** has the format "email"
__website__ of **Company** has format "url"
OperatorFormat nameExample valid value
is a valid emailemailuser@example.com
is a valid urlurlhttps://example.com
is a valid uuiduuid550e8400-e29b-41d4-a716-446655440000
is a valid phonephone+1-555-123-4567
is a valid phone numberphone number+1-555-123-4567
is a valid datedate2024-01-15
is a valid timetime10:30:00
is a valid datetimedatetime2024-01-15 10:30:00
is a valid iso8601iso86012024-01-15T10:30:00Z

All validation operators have a negated form: is not a valid email, is not a valid url, etc.