feat: add auto-generated Zod schemas via Hey API plugin#70
Merged
MathurAditya724 merged 1 commit intomainfrom May 6, 2026
Merged
feat: add auto-generated Zod schemas via Hey API plugin#70MathurAditya724 merged 1 commit intomainfrom
MathurAditya724 merged 1 commit intomainfrom
Conversation
Enable the Hey API Zod plugin to auto-generate Zod v3 schemas from the OpenAPI spec. The schemas are exported from a separate '@sentry/api/zod' entry point so existing consumers are unaffected. - Add 'zod' plugin with compatibilityVersion: 3 to createClient config - Build a separate dist/zod.js bundle with zod externalized - Add zod as an optional peer dependency - Add './zod' subpath export to package.json
Member
Author
|
All 5 CI checks passed (Build, Secret Scan, dependency-review, semgrep, warden). Self-review found no issues — the diff is minimal (3 files, 52 insertions), output verified to use correct Zod v3 syntax with zod externalized from the bundle. Marked ready for review. |
This was referenced May 6, 2026
MathurAditya724
added a commit
to getsentry/sentry-mcp
that referenced
this pull request
May 6, 2026
Picks up v0.141.0 which adds auto-generated Zod schemas via a new '@sentry/api/zod' subpath export (getsentry/sentry-api-schema#70).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add auto-generated Zod v3 schemas from the OpenAPI spec using Hey API's built-in Zod plugin. The schemas are exported from a separate
@sentry/api/zodsubpath entry point so existing consumers are completely unaffected — only those who opt in by importing from@sentry/api/zodwill pull in the zod dependency.Both the CLI (
getsentry/cli) and MCP server (getsentry/sentry-mcp) currently maintain hand-written Zod schemas for Sentry API responses. This change enables them to migrate to auto-generated schemas that stay in sync with the OpenAPI spec automatically.Usage
What changed
build.mjs: Enable thezodplugin withcompatibilityVersion: 3(Zod v3 syntax, matching both consumer repos). Default plugins (@hey-api/typescript,@hey-api/sdk) are listed explicitly since addingpluginsoverrides defaults.build.mjs: Createsrc/zod.tsentry point and bundle it todist/zod.jswithzodexternalized (not bundled — consumers provide their own zod).package.json: Add./zodsubpath export,zodas optional peer dependency, andzodas dev dependency for build-time resolution.Testing
bun run build && bun run typecheck && bun test— all 28 tests pass, typecheck clean,npm packproduces valid package.