feat: upgrade to Zod v4 and use native JSON schema generation - #254
Conversation
- Upgrade zod from ^3.25.16 to ^4.3.5 - Upgrade @modelcontextprotocol/sdk from ^1.11.4 to ^1.25.2 - Remove zod-to-json-schema dependency - Migrate to Zod v4's native toJSONSchema() method - Remove TODO comment as Zod v4 is now stable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary of ChangesHello @chentsulin, 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 modernizes the project's dependency stack by upgrading Zod to its fourth major version and updating the Model Context Protocol SDK. The primary impact is the simplification of JSON schema generation, moving from an external library to Zod v4's native Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
There was a problem hiding this comment.
Code Review
This pull request successfully upgrades Zod to v4 and migrates from zod-to-json-schema to the native toJSONSchema method, which is a great modernization step. The dependency changes in package.json are correct. My review focuses on src/utils/schema.ts, where I've identified a couple of important behavioral changes resulting from this migration related to the generated JSON schema. I've provided a suggestion to align the new implementation with the previous behavior where appropriate and to improve code clarity.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #254 +/- ##
==========================================
- Coverage 81.02% 81.01% -0.01%
==========================================
Files 42 42
Lines 1982 1981 -1
Branches 31 31
==========================================
- Hits 1606 1605 -1
Misses 374 374
Partials 2 2
🚀 New features to boost your workflow:
|
|
fixed #163 |
Summary
toJSONSchema()methodChanges
This PR modernizes our dependency stack by adopting Zod v4, which includes native JSON schema generation capabilities. This allows us to remove the external
zod-to-json-schemapackage, reducing dependencies and using the official Zod v4 API.Key changes:
zod-to-json-schemato Zod's nativetoJSONSchema()methodTest plan