Pingerflows
Schema Validator Node
The schema validator node validates incoming message data against a JSON Schema (draft 4/7). If validation fails the pipeline stops and no broadcast is emitted.
When to Use
- Enforce a strict contract on client-sent messages
- Reject malformed payloads early in the flow
- Prevent downstream nodes from receiving unexpected data shapes
Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
schema | object | Yes | — | A valid JSON Schema object |
target | string | No | "data" | What to validate: "data", "metadata", or "both" |
target values
| Value | Validates |
|---|---|
"data" | context.data — the message payload sent by the client or server |
"metadata" | context.metadata — contains appId, channel, event |
"both" | Merged metadata + data |
Examples
Require specific fields in the payload
{
"schema": {
"type": "object",
"required": ["userId", "text"],
"properties": {
"userId": { "type": "string" },
"text": { "type": "string", "maxLength": 500 }
}
}
}Validate a numeric amount with constraints
{
"schema": {
"type": "object",
"required": ["amount", "currency"],
"properties": {
"amount": { "type": "number", "minimum": 0 },
"currency": { "type": "string", "enum": ["USD", "EUR", "GBP"] }
}
}
}Validate metadata only
{
"schema": {
"type": "object",
"required": ["appId"],
"properties": {
"appId": { "type": "string" }
}
},
"target": "metadata"
}Supported JSON Schema Keywords
Full JSON Schema draft 4/7 is supported, including:
type,enum,constrequired,properties,additionalPropertiesminLength,maxLength,patternminimum,maximum,exclusiveMinimum,exclusiveMaximumminItems,maxItems,items,uniqueItemsallOf,anyOf,oneOf,not$ref(within the same schema document)
On Failure
Validation errors are collected and returned as a human-readable string:
Schema validation failed on data: #/userId: Expected type string, got null, #/amount: Value must be >= 0The pipeline stops; no downstream nodes run and no broadcast is emitted.
Next Steps
- Filter Node — filter using MongoDB-style query operators
- Transform Node — reshape data after validation