Overview
Express Zod API uses branded types to distinguish its proprietary schemas from regular Zod schemas. These brands enable special handling for dates, files, forms, and raw data.The ez Object
All proprietary schemas are accessed through theez object:
Schema Brands
Each proprietary schema has a unique brand for type identification:Date Schemas
ezDateInBrand
Identifies schemas created withez.dateIn().
ezDateOutBrand
Identifies schemas created withez.dateOut().
File Schemas
ezUploadBrand
Identifies file upload schemas created withez.upload().
ezBufferBrand
Identifies buffer schemas for binary responses.Form Schema
ezFormBrand
Identifies form data schemas created withez.form().
Raw Data Schema
ezRawBrand
Identifies raw buffer schemas created withez.raw().
Brand Usage
The framework uses these brands internally to:- Select correct parsers - Form data, JSON, multipart, or raw
- Generate accurate OpenAPI specs - Correct content types and schemas
- Transform data - Convert between Date objects and ISO strings
- Validate input - Apply appropriate validation logic