Support for Zod 4 #2550
Replies: 10 comments 1 reply
-
New version of the framework now supports Zod 4: Because the versioning strategy of Zod has changed since the original message above, the minimum supported version of Zod is This is a breaking change. The framework does NOT support both Zod 3 and Zod 4 simultaneously due to:
In particular, the new version utilizes the new feature of Zod 4 on making JSON Schema for including it into the generated Documentation. Thus, the most of the schema depiction logic is now delegated to Zod 4. There are some other minor breaking changes related to adopting Zod 4 — described in the Changelog. Users are encouraged to try v24 and write their feedback. |
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.2 is out 🚀This version addresses another major opportunity offered by Zod 4 — storage for schema examples.
input: z.string()
+ .example("123") // place for input examples
.transform(Number)
- .example("123") // moves to position before transformation Also, the |
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.3 is out 🚀This time I take one more step forward to native Zod 4's metadata system. - ez.dateIn().example("2021-12-31");
+ ez.dateIn({ examples: ["2021-12-31"] }); |
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.4 is out 🚀
v24.0.0-beta.5 🚀
v24.0.0-beta.6 🚀
|
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.7 is out 🚀
I'm probably gonna make a couple more minor adjustments, but overall I'm glad how it works in this state. |
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.8 🚀
|
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.9 🚀I paired with an AI to perform the final polishing and make small improvements:
|
Beta Was this translation helpful? Give feedback.
-
v24.0.0-beta.10 🚀There was I minor breaking change within internal implementation of Zod's discriminated union schema in version 3.25.35. |
Beta Was this translation helpful? Give feedback.
-
v24.0.0 🚀Stable release is out 🥳 |
Beta Was this translation helpful? Give feedback.
-
🎉 This is great stuff. Thanks for getting to this so quickly! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Zod 4 is now in beta
Hello! Colin here, creator of Zod. Thank you for contributing this package to the Zod ecosystem!
FYI, the first beta of Zod 4 has been released. It will be in beta for 4 weeks to allow time for ecosystem libraries (such as yours) to implement support before the first stable version is released. The first stable release will be in mid-May. Keep an eye on this PR to track progress: colinhacks/zod#4074
Announcement post: https://v4.zod.dev/v4
Migration guide: https://v4.zod.dev/v4/changelog
Migration
There have been some significant changes.
@zod/mini
has been released with a treeshakable/functional API that mirrors Zod'szod
and@zod/mini
, they both have a dependency on a new common core library@zod/core
.zod
and@zod/mini
(and potentially future libraries). It makes it easy to support all these libraries simultaneously, with just one peerDependency on your end. There is little reason for any framework/library to depend directly onzod
anymore.This page is intended as a jumping-off point with some guidance for library authors:
@zod/core
docsDon't hesitate to reach out for help/guidance!
Beta Was this translation helpful? Give feedback.
All reactions