Validator
Validates events using JSON Schema with two modes: format (structure of the full WalkerOS.Event) and contract (entity/action business rules). Invalid events are dropped from the pipeline and logged; valid events pass through unchanged.
Installation
- Integrated
- Bundled
Configuration
This transformer uses the standard transformer config wrapper (consent, data, env, id, ...). For the shared fields see transformer configuration. Package-specific fields live under config.settings and are listed below.
Settings
| Property | Type | Description | More |
|---|---|---|---|
format | boolean | Validate full WalkerOS.Event structure. Pre-compiled at init. | |
contract | object | Event-specific validation rules. Entity/action keyed, supports wildcards. |
Mapping
This package does not define custom rule-level settings. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.
Examples
Contract validation
Contract validation passes when event data matches the entity.action JSON Schema
Valid event
A well-formed product view passes validation and is returned unchanged for downstream destinations.
Validation modes
| Mode | Purpose |
|---|---|
format | Validates full WalkerOS.Event structure |
contract | Validates entity/action-specific business rules |
Logger levels
| Level | Output |
|---|---|
ERROR | Validation failures only |
DEBUG | All validation results (pass and fail) |
Behavior
When validation fails
Invalid events are dropped from the pipeline and do not reach destinations. The validator logs detailed error information:
| Validation | Log message | Includes |
|---|---|---|
| Format | Event format invalid | Field-level errors from AJV |
| Contract | Contract validation failed | Rule name + field-level errors |
Example log output:
[ERROR] Event format invalid { errors: "data/name must match pattern \"^\\w+ \\w+$\"" }
[ERROR] Contract validation failed { rule: "product add", errors: "data must have required property 'id'" }
When validation passes
- Format valid: Event continues to contract validation (if configured)
- Contract valid: Logs debug message, event continues to next transformer or destinations
- No matching contract: Event passes through unchanged (validation is opt-in per entity/action)
Pipeline flow
Event → Format check → Contract check → Next transformer/Destination
↓ ↓
Invalid? Invalid?
↓ ↓
Drop + Log Drop + Log
Conditional rules
Apply different schemas based on event data:
Wildcard patterns
Match multiple events with wildcards:
Next steps
- Create your own - Build custom transformers