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)
__ip__ of **Network** is a valid ip address
__ipv4__ of **Network** is a valid ipv4 address
__ipv6__ of **Network** is a valid ipv6 address
__range__ of **Network** is a valid cidr
__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)
__payload__ of **Webhook** is a valid json
__blob__ of **Asset** is a valid base64
__color__ of **Theme** is a valid hex color
__version__ of **Package** is a valid semver
__config__ of **Service** is a valid toml
__target__ of **Link** is a valid uri reference
__preview__ of **Link** is a valid data url
__address__ of **Device** is a valid mac address

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 ip addressip, ip address192.168.1.10
is a valid ipv4 addressipv4, ipv4 address192.168.1.10
is a valid ipv6 addressipv6, ipv6 address2001:db8::1
is a valid cidrcidr10.0.0.0/24
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
is a valid jsonjson{"ok":true}
is a valid base64base64SGVsbG8=
is a valid hex colorhex color#ff00aa
is a valid semversemverv1.2.3-preview
is a valid tomltomlname = "demo"
is a valid uri referenceuri reference/docs/getting-started#intro
is a valid data urldata urldata:text/plain;base64,SGVsbG8=
is a valid mac addressmac address01:23:45:67:89:ab

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