Validator Syntax
All validators use thename! suffix convention:
! suffix distinguishes validators from regular YAML keys.
Transforms
Transforms allow you to normalize values before validation. This is useful for case-insensitive matching or handling whitespace.Available Transforms
| Transform | Description | Example |
|---|---|---|
lowercase | Convert to lowercase | "Hello" → "hello" |
uppercase | Convert to uppercase | "Hello" → "HELLO" |
trim | Remove leading/trailing whitespace | " hi " → "hi" |
collapse_whitespace | Replace multiple spaces with single | "a b" → "a b" |
Chaining Transforms
Apply multiple transforms in order:trim, then lowercase, then collapse_whitespace.
Negation
Most validators support negation using thenot_ prefix or the negate field.
Using Aliases
Using the negate Field
Combining Negation with Transforms
Validator Categories
Comparison
String matching, patterns, and equality checks
Type
Type checking, JSON, and format validation
Length
Length constraints and bounds
LLM
AI-powered semantic validation
Flow
Execution sequence and parallelism
Quick Reference
| Validator | Category | Description | Example |
|---|---|---|---|
eq! | Comparison | Exact equality | eq!: "hello" |
ne! | Comparison | Not equal | ne!: "error" |
contains! | Comparison | Substring/item check | contains!: "world" |
not_contains! | Comparison | Absence check | not_contains!: "error" |
contains_all! | Comparison | Contains all items | contains_all!: ["a", "b"] |
not_contains_all! | Comparison | Missing at least one | not_contains_all!: ["x", "y"] |
contains_any! | Comparison | Contains at least one | contains_any!: ["a", "b"] |
not_contains_any! | Comparison | Contains none | not_contains_any!: ["x", "y"] |
pattern! | Comparison | Regex match | pattern!: "\\d+" |
not_pattern! | Comparison | Regex non-match | not_pattern!: "^Error" |
starts_with! | Comparison | Prefix check | starts_with!: "Hello" |
not_starts_with! | Comparison | No prefix match | not_starts_with!: "Error" |
ends_with! | Comparison | Suffix check | ends_with!: "." |
not_ends_with! | Comparison | No suffix match | not_ends_with!: "error" |
lt! | Comparison | Less than | lt!: 100 |
lte! | Comparison | Less than or equal | lte!: 100 |
gt! | Comparison | Greater than | gt!: 0 |
gte! | Comparison | Greater than or equal | gte!: 1 |
type! | Type | Type checking | type!: "string" |
not_type! | Type | Type exclusion | not_type!: "null" |
json! | Type | Valid JSON | json!: true |
email! | Type | Email format | email!: true |
not_null! | Type | Non-null check | not_null!: true |
length! | Length | Exact length | length!: 10 |
min_length! | Length | Minimum length | min_length!: 5 |
max_length! | Length | Maximum length | max_length!: 100 |
semantic! | LLM | Semantic match | semantic!: "greeting" |
not_semantic! | LLM | Semantic non-match | not_semantic!: "rude" |
language! | LLM | Language detection | language!: "en" |
not_language! | LLM | Language exclusion | not_language!: "fr" |
seq! | Flow | Execution sequence | See Flow |
parallel! | Flow | Parallel execution | See Flow |