Validations
This section documents Apistry's built-in validation functions.
Apistry uses validation to enforce a strict architectural boundary:
- Persistence establishes durable truth
- Persistence is the execution boundary
- Validations are deterministic, declarative, and evaluated pre-persistence
- Validation failures return HTTP 422 Unprocessable Entity
To reduce conceptual overload, validation documentation is split into:
- Concepts (why/when): Core Concepts → Validation Model (
core-concepts/validation-model.md) - Reference (how/syntax): Reference → Validation Reference (
reference/validation-reference.md) - Function catalog (per-validator semantics): the pages listed below
Validation Categories (catalog index)
The list below categorizes validations by architectural role, not implementation detail, so the validation surface stays stable over time.
1. Scalar Value Constraints
Operate on a single value or a pair of values.
2. Cardinality & Presence Constraints
Operate on sets of fields.
3. Conditional State Constraints
Enforce rules based on presence or equality of other fields.
4. Collection & Structural Constraints
Operate on arrays or object structures.
5. Numeric Aggregation Constraints
Operate over collections with numeric aggregation semantics.
6. Format, Locale & Standards Compliance
Validate values against external standards or well-defined formats.
- base64
- url
- timeZone
- countryCode
- currencyCode
- regionCode
- postalCodeCountry
- statePostalCode
- usPhoneNumber
7. Security & Data Hygiene
Protect against malformed or malicious input.
8. External Admissibility Constraints
Validate request admissibility using authoritative external systems.