
Stop hand-writing TypeScript types from API responses
Every API integration starts the same way: a JSON response in the Network tab, and a developer typing...
Tag archive

Every API integration starts the same way: a JSON response in the Network tab, and a developer typing...
You ask the model for JSON, add "respond with only valid JSON, no markdown" to the prompt, and it...
A customer fills in a checkout form and picks two ceramic mugs and a linen tote. Somewhere between...
70 schemas across 27 files. 39 safeParse calls on the way in, where a failure is a sentence for the person who typed it, and zero on the way out of a model, where a failure is an exception and a retry. Plus 13 places that read a zod error and not one that builds a field map.
Pydantic and Zod both silently drop unknown keys by default. How to close every schema and count rejections when validating LLM tool call arguments.
Adapted from Appendix A of AI Engineering with TypeScript — A Comprehensive Guide to Building AI...

With @panth977/routes, each Node.js endpoint is declared once with zod request and response schemas. That one declaration is the typed handler Express

TypeScript types vanish at runtime. With @panth977/functions, a function declares zod schemas for its input and output, and a SafeParse wrapper checks
Adding answer review to our session reports meant deciding, at the write, at the read and for every row that predates it, what happens when the new optional thing fails.

Why TypeScript types disappear at runtime, and how to use Zod to validate webhook payloads and form submissions at the boundary. Shape, semantics, and…

Zod 4's z.toJSONSchema() drops every .refine() and can't express transforms. Here's what the model sees, and a describe, validate, retry-once fix.

Enforce 100% type-safe JSON API responses from language models using Zod schemas and provider-native constrained decoding in web apps.