Skip to content

feat(zod): promote zod4 converter to stable#763

Merged
dinwwwh merged 1 commit intomainfrom
feat/zod/promote-zod4-converter-to-stable
Jul 14, 2025
Merged

feat(zod): promote zod4 converter to stable#763
dinwwwh merged 1 commit intomainfrom
feat/zod/promote-zod4-converter-to-stable

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented Jul 14, 2025

Summary by CodeRabbit

  • Documentation

    • Updated all documentation and example code to reference ZodToJsonSchemaConverter instead of the previous experimental alias. This streamlines and clarifies usage instructions for OpenAPI spec generation.
  • Refactor

    • Renamed the interface and class for the JSON Schema converter to remove the experimental prefix, reflecting their stable status.
    • Updated all references in the codebase and tests to use the new names, ensuring consistency throughout.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 14, 2025

Walkthrough

All references to the experimental experimental_ZodToJsonSchemaConverter class and its associated options interface were renamed to the stable ZodToJsonSchemaConverter and ZodToJsonSchemaConverterOptions. This affects imports, usage, and declarations across documentation, tests, source, and example files, with no changes to logic or functionality.

Changes

Files/Groups Change Summary
packages/zod/src/zod4/converter.ts Renamed interface and class from experimental_ZodToJsonSchemaConverter* to ZodToJsonSchemaConverter*. Updated all references.
README.md, packages/zod/README.md, apps/content/docs/openapi/..., apps/content/docs/openapi/plugins/openapi-reference.md Updated import statements and usage examples to use ZodToJsonSchemaConverter instead of the experimental alias.
packages/json-schema/src/smart-coercion-plugin.test.ts, packages/openapi/src/openapi-generator.test.ts, packages/zod/src/zod4/converter.components.test.ts, packages/zod/src/zod4/converter.test.ts, packages/zod/tests/shared.ts Updated imports to use ZodToJsonSchemaConverter directly.
playgrounds/astro/src/pages/api/[...rest].ts, playgrounds/contract-first/src/main.ts, playgrounds/nest/src/reference/reference.service.ts, playgrounds/next/src/app/api/[[...rest]]/route.ts, playgrounds/nuxt/server/routes/api/[...].ts, playgrounds/solid-start/src/routes/api/[...rest].ts, playgrounds/svelte-kit/src/routes/api/[...rest]/+server.ts, playgrounds/tanstack-start/src/routes/api/$.ts Updated imports from experimental alias to stable ZodToJsonSchemaConverter.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App/Docs/Test
    participant ZodToJsonSchemaConverter

    User->>App/Docs/Test: Import ZodToJsonSchemaConverter
    App/Docs/Test->>ZodToJsonSchemaConverter: Instantiate/use converter
    ZodToJsonSchemaConverter-->>App/Docs/Test: Convert Zod schema to JSON Schema
    App/Docs/Test-->>User: Return or document JSON Schema
Loading

Possibly related PRs

  • unnoq/orpc#748: Updates usages to the stable ZodToJsonSchemaConverter and introduces a new smart coercion plugin, directly related to this PR's renaming and import changes.
  • unnoq/orpc#760: Introduces the experimental alias and changes imports, which this PR now finalizes and reverses, showing direct code-level connection.
  • unnoq/orpc#206: Major rewrite introducing and restructuring ZodToJsonSchemaConverter, closely related to this PR's stabilization and renaming.

Suggested labels

size:L

Poem

A hop and a skip, we shed "experimental" skin,
Now Zod's converter stands tall, let new tales begin!
Imports are cleaner, the code feels just right,
No more aliases lurking out of sight.
🐇✨
Stable and proud, we leap into the light!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 14, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2025 9:30am

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @unnoq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request officially stabilizes the Zod v4 JSON schema converter by removing its experimental_ prefix. This change signifies that the converter is now considered production-ready, and all relevant code, documentation, and examples have been updated to reflect this new stable status, ensuring users can confidently integrate it into their projects.

Highlights

  • API Stabilization: The ZodToJsonSchemaConverter for Zod v4 has been promoted from an experimental status to stable. This indicates that the converter is now considered production-ready.
  • Codebase Update: All internal references, documentation, and examples across the repository have been updated to reflect the new stable name, ZodToJsonSchemaConverter, removing the experimental_ prefix.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request promotes the Zod v4 converter to a stable feature by removing the experimental_ prefix. The changes are applied consistently across the codebase, including documentation and tests.

Comment on lines +75 to 76
ZodToJsonSchemaConverter
} from '@orpc/zod/zod4' // <-- zod v4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To avoid naming conflicts, rename the imported ZodToJsonSchemaConverter from @orpc/zod/zod4 to ZodToJsonSchemaConverterV4.

Suggested change
ZodToJsonSchemaConverter
} from '@orpc/zod/zod4' // <-- zod v4
import {
ZodToJsonSchemaConverter as ZodToJsonSchemaConverterV4
} from '@orpc/zod/zod4' // <-- zod v4

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jul 14, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@763

@orpc/client

npm i https://pkg.pr.new/@orpc/client@763

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@763

@orpc/experimental-durable-event-iterator

npm i https://pkg.pr.new/@orpc/experimental-durable-event-iterator@763

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@763

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@763

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@763

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@763

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@763

@orpc/react

npm i https://pkg.pr.new/@orpc/react@763

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@763

@orpc/server

npm i https://pkg.pr.new/@orpc/server@763

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@763

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@763

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@763

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@763

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@763

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@763

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@763

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@763

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@763

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@763

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@763

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@763

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@763

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@763

commit: e88d40c

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (1)
apps/content/docs/openapi/openapi-specification.md (1)

70-76: Duplicate identifier: the two ZodToJsonSchemaConverter imports will not compile

Both v3 and v4 snippets import the symbol with the exact same name, which causes a Duplicate identifier 'ZodToJsonSchemaConverter' error in a real TypeScript file.

Either (a) show one of the versions, or (b) alias the second one:

-import {
-  ZodToJsonSchemaConverter
-} from '@orpc/zod/zod4' // <-- zod v4
+// Pick ONE of the two versions, or alias the v4 variant if you want both:
+import {
+  ZodToJsonSchemaConverter as ZodToJsonSchemaConverterV4
+} from '@orpc/zod/zod4' // <-- zod v4

and adjust the later usage accordingly.
Without this change the example cannot be copy-pasted.

♻️ Duplicate comments (4)
playgrounds/nest/src/reference/reference.service.ts (1)

2-2: Same export-resolution concern as noted in smart-coercion-plugin.test.ts
Please verify the ./zod4 sub-path export.

packages/zod/src/zod4/converter.components.test.ts (1)

2-2: Same export-resolution concern as noted earlier
Validate that @orpc/zod/zod4 is an exported entry.

playgrounds/astro/src/pages/api/[...rest].ts (1)

4-4: Same export-resolution concern as noted earlier
Ensure @orpc/zod exposes the ./zod4 path.

playgrounds/solid-start/src/routes/api/[...rest].ts (1)

4-4: Same export-resolution concern as noted earlier
Verify @orpc/zod/zod4 is declared in the package exports.

🧹 Nitpick comments (3)
packages/openapi/src/openapi-generator.test.ts (1)

4-4: Prefer package alias over brittle relative path

Importing from "../../zod/src/zod4" ties the test to the folder layout and bypasses the package entrypoints.
@orpc/zod/zod4 is already used elsewhere and would stay valid even if the repo structure shifts.

-import { ZodToJsonSchemaConverter } from '../../zod/src/zod4'
+import { ZodToJsonSchemaConverter } from '@orpc/zod/zod4'
playgrounds/nuxt/server/routes/api/[...].ts (1)

3-3: Minor: consider re-using a single converter instance

You create two separate new ZodToJsonSchemaConverter() objects (one per plugin).
Unless the plugins mutate converter state, a single shared instance would save tiny allocation time and keep configs in sync.

No action required, just a thought.

playgrounds/svelte-kit/src/routes/api/[...rest]/+server.ts (1)

5-5: Same remark as in Nuxt route – two independent ZodToJsonSchemaConverter instances are instantiated for different plugins; sharing one could be simpler.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c84c835 and e88d40c.

📒 Files selected for processing (19)
  • README.md (1 hunks)
  • apps/content/docs/openapi/getting-started.md (1 hunks)
  • apps/content/docs/openapi/openapi-specification.md (1 hunks)
  • apps/content/docs/openapi/plugins/openapi-reference.md (1 hunks)
  • packages/json-schema/src/smart-coercion-plugin.test.ts (1 hunks)
  • packages/openapi/src/openapi-generator.test.ts (1 hunks)
  • packages/zod/README.md (1 hunks)
  • packages/zod/src/zod4/converter.components.test.ts (1 hunks)
  • packages/zod/src/zod4/converter.test.ts (1 hunks)
  • packages/zod/src/zod4/converter.ts (2 hunks)
  • packages/zod/tests/shared.ts (1 hunks)
  • playgrounds/astro/src/pages/api/[...rest].ts (1 hunks)
  • playgrounds/contract-first/src/main.ts (1 hunks)
  • playgrounds/nest/src/reference/reference.service.ts (1 hunks)
  • playgrounds/next/src/app/api/[[...rest]]/route.ts (1 hunks)
  • playgrounds/nuxt/server/routes/api/[...].ts (1 hunks)
  • playgrounds/solid-start/src/routes/api/[...rest].ts (1 hunks)
  • playgrounds/svelte-kit/src/routes/api/[...rest]/+server.ts (1 hunks)
  • playgrounds/tanstack-start/src/routes/api/$.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: publish-commit
  • GitHub Check: lint
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (10)
packages/json-schema/src/smart-coercion-plugin.test.ts (1)

2-2: Ensure ./zod4 sub-path is properly exported

The new import hinges on @orpc/zod declaring an explicit "./zod4" entry in its "exports" / "types" map; otherwise consumers will get ERR_PACKAGE_PATH_NOT_EXPORTED (Node ≥ 16) or resolution failures in bundlers.

Confirm that packages/zod/package.json (and the build artefacts) include this sub-path before publishing.

packages/zod/tests/shared.ts (1)

5-5: LGTM – stable converter import looks correct
No further issues spotted.

packages/zod/src/zod4/converter.test.ts (1)

4-5: LGTM – import updated to stable name
Everything else in this test remains unaffected.

playgrounds/next/src/app/api/[[...rest]]/route.ts (1)

4-4: Clean API stabilization - LGTM!

The import update from experimental to stable ZodToJsonSchemaConverter is well-executed. The usage patterns remain identical, ensuring smooth transition from experimental to stable API.

packages/zod/README.md (1)

89-89: Documentation properly updated for stable API - LGTM!

The example code correctly demonstrates the stable import path, helping users transition from the experimental API to the stable version.

playgrounds/contract-first/src/main.ts (1)

5-5: Consistent API stabilization across playground - LGTM!

The import update maintains consistency with the broader API stabilization effort while preserving all existing functionality.

apps/content/docs/openapi/plugins/openapi-reference.md (1)

17-17: Documentation correctly updated for stable API - LGTM!

The setup example now properly demonstrates the stable import, ensuring users follow the correct integration pattern.

playgrounds/tanstack-start/src/routes/api/$.ts (1)

4-4: Final piece of consistent API stabilization - LGTM!

The import update completes the cohesive transition from experimental to stable API across all playground examples, maintaining functional consistency.

README.md (1)

178-184: Looks good – import updated to the stable symbol

The example now refers to the promoted ZodToJsonSchemaConverter; no further action required.

apps/content/docs/openapi/getting-started.md (1)

172-180: LGTM – import correctly switched to the stable name

The snippet is self-contained and compiles as-is.

Comment on lines +42 to 44
export interface ZodToJsonSchemaConverterOptions {
/**
* Max depth of lazy type.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Public-API rename introduces a breaking change

Renaming experimental_ZodToJsonSchemaConverterOptionsZodToJsonSchemaConverterOptions without leaving an alias will break every external consumer still importing the experimental name.

Add a backward-compatibility shim so existing users are not forced into an immediate major-version upgrade:

+/** @deprecated – will be removed in the next major */
+export type experimental_ZodToJsonSchemaConverterOptions =
+  ZodToJsonSchemaConverterOptions
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export interface ZodToJsonSchemaConverterOptions {
/**
* Max depth of lazy type.
export interface ZodToJsonSchemaConverterOptions {
/**
* Max depth of lazy type.
*/
}
// @deprecated – will be removed in the next major
export type experimental_ZodToJsonSchemaConverterOptions =
ZodToJsonSchemaConverterOptions
🤖 Prompt for AI Agents
In packages/zod/src/zod4/converter.ts around lines 42 to 44, the interface was
renamed from experimental_ZodToJsonSchemaConverterOptions to
ZodToJsonSchemaConverterOptions, which breaks backward compatibility. To fix
this, add a type alias exporting experimental_ZodToJsonSchemaConverterOptions as
ZodToJsonSchemaConverterOptions so existing consumers can still import the old
name without breaking.

Comment on lines +88 to +96
export class ZodToJsonSchemaConverter implements ConditionalSchemaConverter {
private readonly maxLazyDepth: Exclude<ZodToJsonSchemaConverterOptions['maxLazyDepth'], undefined>
private readonly maxStructureDepth: Exclude<ZodToJsonSchemaConverterOptions['maxStructureDepth'], undefined>
private readonly anyJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['anyJsonSchema'], undefined>
private readonly unsupportedJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['unsupportedJsonSchema'], undefined>
private readonly undefinedJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['undefinedJsonSchema'], undefined>
private readonly interceptors: Exclude<ZodToJsonSchemaConverterOptions['interceptors'], undefined>

constructor(options: experimental_ZodToJsonSchemaConverterOptions = {}) {
constructor(options: ZodToJsonSchemaConverterOptions = {}) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same breaking change for the class – please keep a deprecated alias

+/** @deprecated – will be removed in the next major */
+export class experimental_ZodToJsonSchemaConverter
+  extends ZodToJsonSchemaConverter {}

This adds zero runtime cost yet preserves compatibility for downstream libraries/tests that still rely on the experimental identifier.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export class ZodToJsonSchemaConverter implements ConditionalSchemaConverter {
private readonly maxLazyDepth: Exclude<ZodToJsonSchemaConverterOptions['maxLazyDepth'], undefined>
private readonly maxStructureDepth: Exclude<ZodToJsonSchemaConverterOptions['maxStructureDepth'], undefined>
private readonly anyJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['anyJsonSchema'], undefined>
private readonly unsupportedJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['unsupportedJsonSchema'], undefined>
private readonly undefinedJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['undefinedJsonSchema'], undefined>
private readonly interceptors: Exclude<ZodToJsonSchemaConverterOptions['interceptors'], undefined>
constructor(options: experimental_ZodToJsonSchemaConverterOptions = {}) {
constructor(options: ZodToJsonSchemaConverterOptions = {}) {
export class ZodToJsonSchemaConverter implements ConditionalSchemaConverter {
private readonly maxLazyDepth: Exclude<ZodToJsonSchemaConverterOptions['maxLazyDepth'], undefined>
private readonly maxStructureDepth: Exclude<ZodToJsonSchemaConverterOptions['maxStructureDepth'], undefined>
private readonly anyJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['anyJsonSchema'], undefined>
private readonly unsupportedJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['unsupportedJsonSchema'], undefined>
private readonly undefinedJsonSchema: Exclude<ZodToJsonSchemaConverterOptions['undefinedJsonSchema'], undefined>
private readonly interceptors: Exclude<ZodToJsonSchemaConverterOptions['interceptors'], undefined>
constructor(options: ZodToJsonSchemaConverterOptions = {}) {
// …existing constructor body…
}
}
/** @deprecated – will be removed in the next major */
export class experimental_ZodToJsonSchemaConverter extends ZodToJsonSchemaConverter {}
🤖 Prompt for AI Agents
In packages/zod/src/zod4/converter.ts around lines 88 to 96, the class
ZodToJsonSchemaConverter was renamed or changed, causing a breaking change. To
fix this, add a deprecated alias for the previous class name or identifier that
was used experimentally. This alias should point to the new class without adding
runtime cost, preserving backward compatibility for downstream libraries and
tests that still rely on the old identifier.

@dinwwwh dinwwwh merged commit 9cd4eb7 into main Jul 14, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant