Skip to content

fix: zodResponseFormat deep type error #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bigint
Copy link
Contributor

@bigint bigint commented Jul 22, 2025

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

  • Added a new Prettify helper type to flatten complex Zod output types, preventing excessively deep type instantiation when using Zod helpers
  • Updated zodResponseFormat and zodTextFormat to return simplified types, ensuring smoother compilation with TypeScript
  • Modified zodFunction and zodResponsesFunction so their callback and argument types also leverage the simplified Zod output types

Additional context & links

Fixes #1356

@bigint bigint requested a review from a team as a code owner July 22, 2025 10:55
Copy link
Collaborator

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

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

Thanks! Do you have a minimal reproduction for the linked issue that we could add to the tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type instantiation is excessively deep and possibly infinite with zodResponseFormat on v4.86.1
2 participants