Skip to content

fix(zod): support zod v4 mini schemas#1985

Merged
HAYDEN-OAI merged 2 commits into
openai:mainfrom
morgan-coded:fix/1564-zod-v4-mini
Jul 13, 2026
Merged

fix(zod): support zod v4 mini schemas#1985
HAYDEN-OAI merged 2 commits into
openai:mainfrom
morgan-coded:fix/1564-zod-v4-mini

Conversation

@morgan-coded

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

Changes being requested

zod/v4-mini schemas did not type-check with the structured-output helpers because they only accepted Zod v3 and regular Zod v4 schema types. This widens those helpers to accept mini schemas, keeps the existing v3/v4 JSON Schema conversion paths, and uses one parser path for response, text, and tool arguments. I checked the new mini coverage failing under TypeScript before the helper change, then ran ./scripts/bootstrap, ./scripts/test tests/helpers/zod.test.ts, ./node_modules/typescript/bin/tsc, pnpm build, pnpm lint, and pnpm test with 1145 passing and 1 skipped. Fixes #1564

Additional context & links

@morgan-coded
morgan-coded requested a review from a team as a code owner July 7, 2026 02:58
Copilot AI review requested due to automatic review settings July 7, 2026 02:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

# Conflicts:
#	src/helpers/zod.ts
#	tests/helpers/zod.test.ts
@HAYDEN-OAI
HAYDEN-OAI merged commit 2df10fc into openai:main Jul 13, 2026
10 checks passed
@stainless-app stainless-app Bot mentioned this pull request Jul 13, 2026
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.

Support for zod/v4-mini

3 participants