Paste a sentry event JSON payload and get a Zod z.object schema you can run inside your handler. Same shape walker as the TypeScript-mode page, but the output is a runtime-validated schema with .optional() on missing fields and z.union for nullables.
Sentry webhooks differ sharply by event type (issue.created vs error.created vs metric_alert.critical) — a parse at the /sentry-webhook endpoint forces you to handle the right variant for the action and event type, instead of unsafely indexing into data.issue when the actual payload is data.error.
Sentry webhook receivers are usually long-running Node services where you'll want to discriminate on action and inner event type — Zod's z.discriminatedUnion is the cleanest fit for that pattern, and the larger bundle is irrelevant in a server context. The output is a copy-paste-runnable z.object using only standard Zod primitives (z.string, z.number, z.array, z.union, .optional). Drop it into your handler, run schema.parse(body), and the rest of your code consumes a strongly typed value with no ambient unknowns.