With Zod, Fight Any-gration at Your Borders
summary
Shows how to use the Zod library to validate and parse JSON at application boundaries so mismatches (e.g., name vs firstName, string IDs) are caught early. Covers z.safeParse vs z.parse, coercion and transform (e.g., converting lat/long strings to numbers), composing address and user schemas, deriving TypeScript types from schemas, and recommends preferring parse and using value objects for email. Demonstrates code examples (fetch user), and mentions ecosystem tools like zod-form-data and TRPC integration for typed endpoints.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 4:44Boundaries and trust zones
- 10:07Why choose Zod
- 16:48Parse vs validate
- 23:27Dynamic types and schemas
- 28:42Three key tips
related talks
31mEscaping the Phantom Zone of Insecure Data: Build Safer Applications with zod
23mType-safe forms for React using Zod
45mBuild Fully Type Safe Projects with TypeScript and Zod
15mValidate HTTP request with HttpClient & Zod - Lightning talk
21mKeep alive your typescript definitions using Zod
15mTypescript. Runtime. And In Between.
21mBeyond Type Checking Building Bulletproof TypseScript Applications
49mTypescript. Runtime. And in Between.
