[hotfix][mcp] Fix MCPTool Jackson deserialization by ignoring unknown properties#522
Closed
avichaym wants to merge 1 commit intoapache:mainfrom
Closed
[hotfix][mcp] Fix MCPTool Jackson deserialization by ignoring unknown properties#522avichaym wants to merge 1 commit intoapache:mainfrom
avichaym wants to merge 1 commit intoapache:mainfrom
Conversation
…n properties MCPTool deserialization fails with UnrecognizedPropertyException when a default ObjectMapper encounters the 'name' and 'description' fields serialized from the parent Tool class. These fields are not declared in MCPTool's @JsonCreator constructor. This breaks checkpoint/restore and any JSON round-trip of MCPTool. Add @JsonIgnoreProperties(ignoreUnknown = true) to MCPTool and a regression test that uses a default ObjectMapper (the existing test masked the bug by disabling FAIL_ON_UNKNOWN_PROPERTIES globally).
|
@avichaym Please add the following content to your PR description and select a checkbox: |
Contributor
|
Sounds like a valid issue. Why is this closed? |
Author
|
hi @xintongsong - im not sure ... i changed some things in my local fork repo and it was auto closed, probably because it represents an obsolete branch. i didnt find a way to fix this in this PR so pushed a new one - #532 . sorry for the confusion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
MCPTooldeserialization fails withUnrecognizedPropertyExceptionwhen a defaultObjectMapperencounters thenameanddescriptionfields serialized from the parentToolclass. These fields are not declared inMCPTool's@JsonCreatorconstructor.This breaks checkpoint/restore and any JSON round-trip of
MCPTool.Brief change log
@JsonIgnoreProperties(ignoreUnknown = true)toMCPTooltestJsonDeserializationWithDefaultMapperthat uses a defaultObjectMapper(the existingtestJsonSerializationmasked the bug by disablingFAIL_ON_UNKNOWN_PROPERTIESglobally)Does this pull request potentially affect one of the following parts
Documentation
N/A — bug fix only
Documentation
doc-neededdoc-not-neededdoc-included