Using Zod for runtime validation?
My go-to patterns:
-
z.object({})
for schema-first mindset
- .refine()
for custom rules
- Nesting with .merge()
keeps things DRYBonus: reuse same schema for frontend + backend.