Add deprecated target aliases to toJSONSchema types#5659
Open
mattrossman wants to merge 1 commit intocolinhacks:mainfrom
Open
Add deprecated target aliases to toJSONSchema types#5659mattrossman wants to merge 1 commit intocolinhacks:mainfrom
mattrossman wants to merge 1 commit intocolinhacks:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
LGTM. Minor, non-blocking: this is a straightforward type addition that exposes already-supported runtime aliases to TypeScript autocomplete. The motivation is clear and the implementation is correct.
Contributor
Review Complete ✅Reviewed the PR and approved. The change correctly exposes existing runtime aliases ( |
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.
Adds "draft-4" and "draft-7" in the target types for
z.toJSONSchema().These aliases are already supported at runtime via normalization but were not discoverable via TypeScript autocomplete.
zod/packages/zod/src/v4/core/json-schema-generator.ts
Lines 86 to 87 in 7b43bc6
Rationale is we target
"draft-07"in@supabase/mcp-server-supabasebut consume this package from apps that use both 4+ and 3.25+ Zod versions.https://github.com/supabase-community/supabase-mcp/blob/f4c1a1f2a7a839ecc75e9bdc92832f2144689c76/packages/mcp-utils/src/server.ts#L445
This unknowingly introduced runtime errors for apps that use the older v4 Zod APIs that don't recognize
"draft-07". We'd like to instead target"draft-7"which is supported in both versions, but not clear from the types.