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:Schema shape
For an Endpoint, the root is aValidatorSchema object whose schema is an object with objectSchema entries. Use profile: "strict" for new contracts. Schemas without a profile preserve legacy behavior; review accepted and rejected values before changing an existing profile.
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
In the strict profile, numbers must be finite and
null requires nullable: true. A strict date accepts a valid Date value or a supported date/date-time string; legacy date rules also accept values parsable as JavaScript dates. any skips type constraints, but presence, nullability and resource limits still apply. Default string length is measured in UTF-16 code units.
Validation has limits on schema size, nesting, input processing and error output. A successful example is not proof that unbounded arrays or arbitrarily complex rules will fit every execution budget.
Choose explicit rules before regex
Preferenum for known values, const for a single value, and type, length, numeric range or supported date/time rules for their respective constraints. Add regex only when the contract requires a text pattern those rules cannot express.
A simple regex can roughly double request-preparation time or more, even for small payloads. This adds CPU work and latency; it is not limited to unusually complex patterns. Measure representative requests when introducing a pattern on a frequently called Endpoint.
The schema example above explicitly limits currencies to three codes and accepts a nonempty order identifier of up to 64 code units. If your contract requires a specific identifier pattern, retain that requirement and use a regex when necessary. Do not remove a validation constraint to gain speed. Check case sensitivity, whitespace, empty values and trailing newlines when replacing an existing regex.
Measured scale of the difference
The comparison below uses the same valid requests and the same structural rules. One field accepts exactlyPL01, PL02 or PL03: one variant uses enum, the other uses regex: "^(PL01|PL02|PL03)$". Both require a string with max: 4, so a trailing newline is rejected as well. Matching and rejecting examples were checked before timing.
These are median Endpoint request-preparation times from a controlled single-CPU benchmark, with 30 measured calls per variant after warmup. Requests contain arrays of records with a nested 30-field object. The measurement includes route resolution, guard validation, request-log preparation and execution-context assembly. It excludes network time, HTTP parsing, authentication, real database access and business execution.
Use the table to understand scale, not as a latency guarantee or a multiplier for the entire HTTP request. The effect depends on the schema, data shape, number and length of strings, concurrency and available capacity. These Endpoint measurements are not timings for every
util.validate() call.
Unknown fields
For new schemas, useadditionalProperties: "allow", "strip" or "reject". A root policy supplies the default for object rules; an object’s own policy overrides it. The strict default is reject.
Existing schemas retain the legacy flag behavior:
An explicit
additionalProperties policy takes precedence over these legacy flags. Choose reject when an API contract must refuse unknown input; choose strip deliberately when passing only declared fields onward.
Attach a reusable validator to an Endpoint
Configure the schema Component under the Endpoint’soptions. Pin componentSchemaVersion for a stable contract; omit it only when the Endpoint should deliberately follow the latest active validator version.
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.
Call it with await. The result contains valid, compatible string errors, structured issues (code, path, message, optional params) and the validated value. After success, use value so configured field removal is respected. Execution or capacity failures can reject the Promise; handle these separately from a normal invalid-data result.
Test matrix
Before activation, test at least:- a valid complete request;
- every required field missing;
- a wrong primitive type;
- minimum, maximum, enum/const and, when used, regex boundaries;
- missing versus null and empty values;
- an invalid array item;
- an unexpected property in the selected unknown-field mode;
- missing, empty, and dynamic route parameter cases.

