-
-
Notifications
You must be signed in to change notification settings - Fork 737
feat(zod)!: upgrade to Zod v4, remove zod-to-json-schema #3482
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
Conversation
|
@MuntasirSZN is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
Maybe this should be a breaking change? |
commit: |
- Replace complex post-processing with Zod v4's built-in override
callback
- Use target: 'draft-7' for proper nullable handling (anyOf instead of
oneOf)
- Handle dates with override callback for {type: "string", format:
"date-time"}
- Reduce implementation from ~100 lines to ~20 lines of processing
- Fix import paths from 'zod/v4/core' to 'zod/v4' across codebase
|
Thanks for the PR @MuntasirSZN Meanwhile I'll keep it PR pending so users can user Zod4 with PR release |
|
@farnabaz what about Standard Schema? I am happy to implement that. |
AFAIK, The issue with standard schema is it does not expose schema and only expose unified validation. But I would be happy to see Standard Schema working in Nuxt Content |
We need nuxt/content#3482, to resolve some very interesting issues while running vitest on GitHub actions.
|
Maybe for now a compatibility layer could be added to fix #3462 without fully updating to zod v4? |
We need nuxt/content#3482, to resolve some very interesting issues while running vitest on GitHub actions.
test: add raw zod toJSONSchema passthrough tests (editor meta, nullable anyOf, union anyOf, intersection allOf) chore: satisfy eslint for zod editor augmentation and tests chore: lint and fix chore: fix typo
|
Checkout #3524 |
π Linked issue
β Type of change
π Description
Upgrades from Zod v3 to v4 using native toJSONSchema() method, replacing the zod-to-json-schema dependency. toJsonSchema doesn't support dates, so had to go through that.
π Checklist