Title: Add @JsonIgnoreProperties(ignoreUnknown = true) to capability sub-records by rameshreddy-adutla · Pull Request #852 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: Add @JsonIgnoreProperties(ignoreUnknown = true) to capability sub-records by rameshreddy-adutla · Pull Request #852 · modelcontextprotocol/java-sdk
X Title: Add @JsonIgnoreProperties(ignoreUnknown = true) to capability sub-records by rameshreddy-adutla · Pull Request #852 · modelcontextprotocol/java-sdk
Description: Summary Add @JsonIgnoreProperties(ignoreUnknown = true) to all capability sub-records that are missing the annotation, ensuring forward compatibility when the MCP spec adds new fields. Problem The top-level ClientCapabilities and ServerCapabilities records have @JsonIgnoreProperties(ignoreUnknown = true), but their nested sub-records do not. Since the ObjectMapper defaults to FAIL_ON_UNKNOWN_PROPERTIES = true, any unknown field on a capability sub-object causes a deserialization failure. This already caused a real breakage when the elicitation capability gained form and url fields (#724, fixed in #731). The systemic issue remains — the next spec addition to any capability sub-object will break older SDK versions. The MCP spec schema explicitly does not close capability objects (additionalProperties: false is never set). Several sub-capabilities (sampling, elicitation, completions, logging) explicitly set additionalProperties: true. Fix Add @JsonIgnoreProperties(ignoreUnknown = true) to: Record Location ClientCapabilities.Sampling Line ~407 ClientCapabilities.Elicitation Line ~434 ClientCapabilities.Elicitation.Form Line ~440 ClientCapabilities.Elicitation.Url Line ~447 ServerCapabilities.CompletionCapabilities Line ~549 ServerCapabilities.LoggingCapabilities Line ~556 ServerCapabilities.PromptCapabilities Line ~566 ServerCapabilities.ResourceCapabilities Line ~577 ServerCapabilities.ToolCapabilities Line ~588 Testing Added 9 targeted tests in McpSchemaTests that verify each sub-record correctly ignores unknown fields during deserialization. All existing tests continue to pass. Fixes #766 Related: #734
Open Graph Description: Summary Add @JsonIgnoreProperties(ignoreUnknown = true) to all capability sub-records that are missing the annotation, ensuring forward compatibility when the MCP spec adds new fields. Problem The ...
X Description: Summary Add @JsonIgnoreProperties(ignoreUnknown = true) to all capability sub-records that are missing the annotation, ensuring forward compatibility when the MCP spec adds new fields. Problem The ...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/pull/852
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3fd822c9-b373-157a-6c3c-4e806e0d4a3a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8C06:1E741D:1CC7ECE:265ABDC:6A5BCC72 |
| html-safe-nonce | d18a3c2abf2533d7a742da2740ec0409dd0acc00cf3396b4352fc20283e673c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzA2OjFFNzQxRDoxQ0M3RUNFOjI2NUFCREM6NkE1QkNDNzIiLCJ2aXNpdG9yX2lkIjoiNTg0NTc0OTQxMjc3NDI2ODAxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 86f6cbd9579c192c927d640bb7a91dfa17dab29c470c71ca4be2343f5116026e |
| hovercard-subject-tag | pull_request:3355297362 |
| 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/852/files |
| twitter:image | https://avatars.githubusercontent.com/u/134313151?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/134313151?s=400&v=4 |
| og:image:alt | Summary Add @JsonIgnoreProperties(ignoreUnknown = true) to all capability sub-records that are missing the annotation, ensuring forward compatibility when the MCP spec adds new fields. Problem The ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width