JSON Schema Validate
Validate the packet against an inline JSON Schema; route valid/invalid.
Overview
| Property | Value |
|---|---|
| Node ID | core/json-schema-validate |
| Kind | router |
| Module | core-flowdsl |
| Repo | go-flowdsl |
| Handler | github.com/redelay/go-flowdsl/nodes/core.JSONSchemaValidate |
| Icon | lucide:shield-check |
| Color | #10b981 |
| Tags | validation, schema |
Description
Lightweight JSON Schema validator (draft 2020-12 subset — type, required,
properties, enum, minimum, maximum, minLength, maxLength, pattern, items).
Route Valid/Invalid. Never fails the run: on failure the packet goes to
invalid with _errors (path-tagged messages) and _route: invalid.
This is the node for input the CALLER must get back. In a flow behind
redelay/http-endpoint, wire invalid to a terminal that sets
status_code (e.g. 422) plus your own fields — the dispatcher answers with
exactly that (see "Rejecting a request" in the flow-driven endpoints
reference). Contrast core/assert and core/require-fields, which fail the
run and therefore answer 500.
Traps (verified against validateSchema, 2026-10-26):
- Keywords outside the list above are IGNORED, not rejected:
const,format,additionalProperties,minItems,oneOf… pass every value.{"const": true}admitsfalse. enumcompares as strings ("true"matchestrue,"1"matches1). Pair it withtype:{"type": "boolean", "enum": [true]}is the only form that admits exactlytrue.- An invalid
patternregex is skipped silently (every string passes). propertiesare checked only for keys that are present; list them inrequiredtoo.
Outputs
valid— (no description)invalid— (no description)
Settings
| Property | Type | Required | Default | UI Group | Description |
|---|---|---|---|---|---|
schema | object | yes | map[] | — | JSON Schema |
sourcePath | string | — | — | — | Path to validate (default = whole packet). |
Example
# Use this node in a flow:
nodes:
- id: my_step
name: My Step
kind: router
action_ref: core/json-schema-validate
config:
schema: {}
sourcePath: some.packet.path