Validation Operators
Validation operators check that a value conforms to a specific format.
Email Validation
Section titled “Email Validation”__email__ of **User** is a valid email
__email__ of **User** is not a valid emailInteractive Example
Policy Rule
Test Data (JSON)
URL Validation
Section titled “URL Validation”__website__ of **Company** is a valid urlInteractive Example
Policy Rule
Test Data (JSON)
UUID Validation
Section titled “UUID Validation”__id__ of **Record** is a valid uuidInteractive Example
Policy Rule
Test Data (JSON)
Phone Number Validation
Section titled “Phone Number Validation”__phone__ of **Contact** is a valid phone
__phone__ of **Contact** is a valid phone numberInteractive Example
Policy Rule
Test Data (JSON)
IP Address Validation
Section titled “IP Address Validation”__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 cidrDate Validation
Section titled “Date Validation”__birthday__ of **Person** is a valid dateInteractive Example
Policy Rule
Test Data (JSON)
Time Validation
Section titled “Time Validation”__start_time__ of **Event** is a valid timeDateTime Validation
Section titled “DateTime Validation”__created_at__ of **Record** is a valid datetimeISO 8601 Validation
Section titled “ISO 8601 Validation”__timestamp__ of **Log** is a valid iso8601Interactive Example
Policy Rule
Test Data (JSON)
Syntax Validation
Section titled “Syntax Validation”__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 addressFormat Shorthand
Section titled “Format Shorthand”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"All Validation Types
Section titled “All Validation Types”| Operator | Format name | Example valid value |
|---|---|---|
is a valid email | email | user@example.com |
is a valid url | url | https://example.com |
is a valid uuid | uuid | 550e8400-e29b-41d4-a716-446655440000 |
is a valid phone | phone | +1-555-123-4567 |
is a valid phone number | phone number | +1-555-123-4567 |
is a valid ip address | ip, ip address | 192.168.1.10 |
is a valid ipv4 address | ipv4, ipv4 address | 192.168.1.10 |
is a valid ipv6 address | ipv6, ipv6 address | 2001:db8::1 |
is a valid cidr | cidr | 10.0.0.0/24 |
is a valid date | date | 2024-01-15 |
is a valid time | time | 10:30:00 |
is a valid datetime | datetime | 2024-01-15 10:30:00 |
is a valid iso8601 | iso8601 | 2024-01-15T10:30:00Z |
is a valid json | json | {"ok":true} |
is a valid base64 | base64 | SGVsbG8= |
is a valid hex color | hex color | #ff00aa |
is a valid semver | semver | v1.2.3-preview |
is a valid toml | toml | name = "demo" |
is a valid uri reference | uri reference | /docs/getting-started#intro |
is a valid data url | data url | data:text/plain;base64,SGVsbG8= |
is a valid mac address | mac address | 01:23:45:67:89:ab |
All validation operators have a negated form: is not a valid email, is not a valid url, etc.