Skip to main content

util.validate()

Validates a payload with the platform schema validator used by Endpoints. Notes:
  • Prefer enum/const, types, lengths, numeric bounds and supported date/time formats over regex when equivalent.
  • Use regex only for a required text pattern; even simple patterns can materially increase Endpoint guard preparation time.
  • Use profile: ‘strict’ for new schemas; omitted profiles retain legacy behavior.
  • required controls presence, nullable controls null, and empty controls empty strings and arrays.
  • Use additionalProperties: ‘allow’, ‘strip’ or ‘reject’ for unknown fields.
  • Legacy whitelist: true retains unknown fields. With whitelist: false, whitelistErrors: false removes them; true reports errors.
  • The result contains valid, errors, issues and value. Structured issues expose code, path, message and optional params.
  • After success, use value so configured field removal is respected.
  • Input, schema and execution limits apply; cyclic data is rejected. Capacity or execution failures can reject the Promise.

Signature

Example

See all util methods or runtime basics.
Last modified on November 8, 2026