Title: fix: Remove JsonSchema and use a Map for inputSchema to support json schemas dialect by bilaloumehdi · Pull Request #749 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: fix: Remove JsonSchema and use a Map for inputSchema to support json schemas dialect by bilaloumehdi · Pull Request #749 · modelcontextprotocol/java-sdk
X Title: fix: Remove JsonSchema and use a Map for inputSchema to support json schemas dialect by bilaloumehdi · Pull Request #749 · modelcontextprotocol/java-sdk
Description: Following the Model Context Protocol specification for JSON schemas usage, the schema should, by default follow the 2020-12 dialect: json-schema-2020-12 if no $schema specified.
Motivation and Context
The need for this change arose from the requirement for a tool that can handle one of two properties objects. This can be achieved by defining an inputSchema with oneOf at the top level, for example:
inputSchema: {
type: object,
oneOf: [
{ properties: {}, required: ["test"] },
{ properties: {}, required: ["test", "command"] }
]
}
The current state
The schema is currently deserialized to a JsonSchema record and ignores oneOf at the top level. A specific fix for this issue would be to add a new field to the JsonSchema record for oneOf; however, this approach does not scale well if additional top-level entries (such as allOf) are needed. This PR shifts to using a Map
Open Graph Description: Following the Model Context Protocol specification for JSON schemas usage, the schema should, by default follow the 2020-12 dialect: json-schema-2020-12 if no $schema specified. Motivation and Con...
X Description: Following the Model Context Protocol specification for JSON schemas usage, the schema should, by default follow the 2020-12 dialect: json-schema-2020-12 if no $schema specified. Motivation and Con...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/pull/749
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:49f8dcda-c277-8a98-4d5a-3a14634f4e78 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9258:108A23:2BEA51:407E5E:6A61E38D |
| html-safe-nonce | 6fcc1727ba2f10da2803f6d89f7f0ed599f1645b64f4fa58a1005ff22c4c944b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjU4OjEwOEEyMzoyQkVBNTE6NDA3RTVFOjZBNjFFMzhEIiwidmlzaXRvcl9pZCI6IjUzODc5ODc4NzE2NTAyMTA2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bdf5236822bb1a8d09ff39a0db5af27b95c47bc3ebd79213c8bfea6b5a88edfa |
| hovercard-subject-tag | pull_request:3171629830 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/java-sdk/pull/749/files |
| twitter:image | https://avatars.githubusercontent.com/u/95442422?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/95442422?s=400&v=4 |
| og:image:alt | Following the Model Context Protocol specification for JSON schemas usage, the schema should, by default follow the 2020-12 dialect: json-schema-2020-12 if no $schema specified. Motivation and Con... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width