Runtime validation with zod (intro)
Validate JSON responses at runtime with zod schemas to ensure safety beyond compile-time types.
Intro
Goal: Add runtime safety with zod. Compile-time types are not enough, so schemas validate live data.
Install zod
Install zod, a popular runtime schema validation library for TS/JS.
npm install zodAll lessons in this course
- Fetch API types; Response.json() generics
- Runtime validation with zod (intro)