Transforms
Validation modes: Validation modes reference
Transform attaches decode/encode functions to schemas without mutating them (stored in a WeakMap). After a transform is registered, instantiate() automatically applies the decoder before validation — decode's output is what gets validated, defaulted, and stripped. See Canonical decode/default ordering.
Methods
| Method | Description | Mode |
|---|---|---|
Transform.create / jt.encode | Attach decode/encode pair; encode domain → wire | Compile-time + Runtime |
Transform.brand | Compile-time nominal brand (no runtime effect) | Compile-time |
Transform.chain | Multi-step decode/encode chain | Compile-time + Runtime |
All examples use the bookstore domain.
Related
instantiate- appliesdecodeduring instantiationdump- appliesencodeduring serializationjt.encode- single-schema encode stepConstraint brands- automatic brands from JSON Schema keywords
See also
- Bookstore domain - schemas used throughout transform examples
- Picking a method - when transforms are applied vs when to apply manually