What problem does it solve?
This guide standardizes and enforces Esposter's Zod v4 schema conventions to ensure consistent type-safety, boundary validation, and predictable JSON schema generation across services and UI forms.
Core Features & Use Cases
- Enforces usage of the z namespace (z.string, z.object, etc.) and discourages legacy string-based chaining.
- Promotes safe string handling with transform().pipe() instead of overwrite, and uses createUniqueArraySchema for arrays to guarantee uniqueness.
- Provides patterns for boundary data validation, form schemas, and ToData mappings for class types to align runtime data with TypeScript types.
- Supports co-located schemas with proper typing using satisfies z.ZodType<T> and generic factory patterns for reusable schemas.
Quick Start
Create a basic Zod schema using the z namespace and validate a boundary payload with .parse() to ensure type-safety.