Skip to main content

Validator

Server Source code Package

Validates events using JSON Schema with two modes: format (structure) and contract (business rules).

Setup

Install the package:

Loading...

Configure in your code:

Loading...

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)

Configuration

PropertyTypeDescriptionMore
formatbooleanValidate full WalkerOS.Event structure. Pre-compiled at init.
contractobjectEvent-specific validation rules. Entity/action keyed, supports wildcards.
OptionTypeDefaultDescription
formatbooleantrueValidate full WalkerOS.Event structure
contractContract-Entity/action keyed validation rules

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 Professional Support?
Need professional support with your walkerOS implementation? Check out our services.