Using Zod to Parse a JSON String
Parse a JSON string and validate the resulting data shape in one composable Zod schema.
- typescript
- zod
- validation
Writing
Software architecture, systems, delivery, experiments, and the occasional useful detour. Short notes and deeper pieces live together here.
Subscribe by RSSParse a JSON string and validate the resulting data shape in one composable Zod schema.
A brief introduction to discriminated unions, type narrowing, and validating tagged data with Zod.