JSON Schema Validate

Validate the packet against an inline JSON Schema; route valid/invalid.

2 min readNode

Overview

PropertyValue
Node IDcore/json-schema-validate
Kindrouter
Modulecore-flowdsl
Repogo-flowdsl
Handlergithub.com/redelay/go-flowdsl/nodes/core.JSONSchemaValidate
Iconlucide:shield-check
Color#10b981
Tagsvalidation, 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} admits false.
  • enum compares as strings ("true" matches true, "1" matches 1). Pair it with type: {"type": "boolean", "enum": [true]} is the only form that admits exactly true.
  • An invalid pattern regex is skipped silently (every string passes).
  • properties are checked only for keys that are present; list them in required too.

Outputs

  • valid — (no description)
  • invalid — (no description)

Settings

PropertyTypeRequiredDefaultUI GroupDescription
schemaobjectyesmap[]—JSON Schema
sourcePathstring———Path to validate (default = whole packet).

Example

yaml
# 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
Was this page helpful?