Skip to main content

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 the ez object:

Schema Brands

Each proprietary schema has a unique brand for type identification:

Date Schemas

ezDateInBrand

Identifies schemas created with ez.dateIn().

ezDateOutBrand

Identifies schemas created with ez.dateOut().

File Schemas

ezUploadBrand

Identifies file upload schemas created with ez.upload().

ezBufferBrand

Identifies buffer schemas for binary responses.

Form Schema

ezFormBrand

Identifies form data schemas created with ez.form().

Raw Data Schema

ezRawBrand

Identifies raw buffer schemas created with ez.raw().

Brand Usage

The framework uses these brands internally to:
  1. Select correct parsers - Form data, JSON, multipart, or raw
  2. Generate accurate OpenAPI specs - Correct content types and schemas
  3. Transform data - Convert between Date objects and ISO strings
  4. Validate input - Apply appropriate validation logic

Type Safety

Brands ensure type safety throughout the request/response cycle:

Combining Schemas

Proprietary schemas work seamlessly with regular Zod schemas:

See Also

ez Schemas

Complete ez schema reference

Zod Plugin

Zod extensions and helpers

Schema Validation

Input/output validation

OpenAPI

OpenAPI schema generation