Skip to main content
JSON_VALIDATOR is a Component type for declarative validation. It contains exactly one element whose source is a JSON validator schema. Use it directly in Sandbox validation, attach it to an Endpoint as a reusable guard, or use an inline copy under an Endpoint’s options.guard when reuse is unnecessary.

Where validation runs

For an Endpoint, validation happens after method/path matching and before the target Component is resolved. The value being validated has this shape:
Do not validate the raw transport request in application code when a boundary rule is known in advance. A guard produces a controlled client error before business logic, Storage access, database writes, or integration calls begin.

Schema shape

The root is always a ValidatorSchema object. Its schema must be an object with objectSchema entries.
At the Endpoint boundary, root properties are body, query, headers, and parameters. query, headers, and parameters must be an object (or any); body may use any supported type. A route without dynamic segments normally receives an empty parameters object.

Property rules

date accepts a valid JavaScript date value or a value parsable as a date. any accepts an already-present value without type checks. An object field missing from the request only fails when that field is required.

Unknown fields

The current runtime treats the two root flags as follows: This behavior is relevant when a validated object is reused later in the same execution. Choose the explicit error mode for public contracts that must reject unknown input; do not rely on stripping alone as a security control.

Attach a reusable validator to an Endpoint

Configure the schema Component under the Endpoint’s options. Pin componentSchemaVersion for a stable contract; omit it only when the Endpoint should deliberately follow the latest active validator version.
Use either guard or componentSchemaId as the source of a contract. A reusable schema Component improves consistency across Endpoints; an inline guard keeps a one-off contract next to its Endpoint.

util.validate() in low-code

For validation inside a Component, use util.validate(). It uses the same schema model but does not replace Endpoint boundary validation: the target Component has already started when it runs.

Test matrix

Before activation, test at least:
  • a valid complete request;
  • every required field missing;
  • a wrong primitive type;
  • minimum, maximum, and regex boundaries;
  • an invalid array item;
  • an unexpected property in the selected unknown-field mode;
  • missing, empty, and dynamic route parameter cases.
Validation errors can reflect caller input. Do not return raw errors when field names, policy details, or submitted values would disclose sensitive information. Prefer a concise customValidateResponse for public APIs.
Last modified on September 5, 2026