-
Notifications
You must be signed in to change notification settings - Fork 403
fix(shemars): use JSON Schema 2020-12 as Default Dialect #549
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the JSON Schema generation to use the 2020-12 dialect instead of draft-07, aligning with recent updates to the Model Context Protocol specification (referenced in PR #655).
Key Changes:
- Updated schema generation from
draft07()todraft2020_12()with removal of theAddNullabletransform (now handled automatically) - Updated schemars dev-dependency to version 1.1.0 to support the new draft
- Refactored test to verify complete schema output instead of just checking enum count
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/rmcp/src/handler/server/common.rs | Updated schema generation to use draft2020_12 and removed AddNullable transform |
| crates/rmcp/tests/test_complex_schema.rs | Enhanced test with complete schema validation matching 2020-12 format ($defs instead of definitions) |
| crates/rmcp/Cargo.toml | Updated schemars dev-dependency to version 1.1.0 |
| README.md | Added documentation about JSON Schema 2020-12 requirement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - [serde required](https://github.com/serde-rs/serde) | ||
|
|
||
| Json Schema generation(Must follow the 2020-12 version): | ||
| - [shemars required](https://github.com/GREsau/schemars) |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in "shemars" - should be "schemars".
| - [shemars required](https://github.com/GREsau/schemars) | |
| - [schemars required](https://github.com/GREsau/schemars) |
| [dev-dependencies] | ||
| tokio = { version = "1", features = ["full"] } | ||
| schemars = { version = "1.0", features = ["chrono04"] } | ||
| schemars = { version = "1.1.0", features = ["chrono04"] } |
Copilot
AI
Nov 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dev-dependency for schemars is being updated to version 1.1.0, but the main dependency at line 32 remains at version 1.0. This creates a version mismatch that could lead to compilation issues or unexpected behavior. Since draft2020_12() requires schemars 1.1.0+, the main dependency should also be updated to match.
Consider updating the main dependency to:
schemars = { version = "1.1.0", optional = true, features = ["chrono04"] }There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jokemanfire Looks like something to look at if we need the bump across the board?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trace it in #182 , there should still be some work to be done here, and we may introduce some broken change.
|
Optional data I need to confirm |
The spec has update.
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context