Skip to main content

Validator

Server Source code Package

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

Loading...
Loading...

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

PropertyTypeDescriptionMore
formatbooleanValidate full WalkerOS.Event structure. Pre-compiled at init.
contractobjectEvent-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 pass

Event
Out

invalid format

Event
Out

valid event

Event
Out

Validation modes

ModePurpose
formatValidates full WalkerOS.Event structure
contractValidates entity/action-specific business rules

Logger levels

LevelOutput
ERRORValidation failures only
DEBUGAll 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:

ValidationLog messageIncludes
FormatEvent format invalidField-level errors from AJV
ContractContract validation failedRule 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:

Loading...
Wildcard patterns

Match multiple events with wildcards:

Loading...

Next steps

💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)