Validate HTTP request with HttpClient & Zod - Lightning talk
summary
Concrete claim: combine Angular HttpClient with Zod to validate API shapes at runtime and stop wrong data before it reaches application code. Demo hits GitHub search, defines Zod schema -> TypeScript type, calls HttpClient and runs zod.parse to throw a ZodError when IDs change from number to string, and wires a custom RxJS zodValidation operator so the pipeline fails loudly and the UI avoids showing bad results.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:07TypeScript types limitations
- 3:20Introducing Zod
- 6:34Live demo Zod & HttpClient
- 11:31Zod validation operator
- 12:59Zod benefits
- 14:27Closing
related talks
31mEscaping the Phantom Zone of Insecure Data: Build Safer Applications with zod
45mBuild Fully Type Safe Projects with TypeScript and Zod
30mWith Zod, Fight Any-gration at Your Borders
23mType-safe forms for React using Zod
21mKeep alive your typescript definitions using Zod
20mREST API Validation in a Typescript front-end
15mTypescript. Runtime. And In Between.
21mBeyond Type Checking Building Bulletproof TypseScript Applications
