Skip to content

Fix reasoning item deserialization (unrecognized "content" field) - #372

Open
amavashev wants to merge 16 commits into
sashirestela:mainfrom
amavashev:main
Open

Fix reasoning item deserialization (unrecognized "content" field)#372
amavashev wants to merge 16 commits into
sashirestela:mainfrom
amavashev:main

Conversation

@amavashev

Copy link
Copy Markdown

Summary

Fixes a JsonMappingException when deserializing Responses API output. Reasoning items now include a content field (holding reasoning_text content), which the current ReasoningItem model does not declare, causing:

UnrecognizedPropertyException: Unrecognized field "content"
  (class ...Input$Item$ReasoningItem), not marked as ignorable

Changes

  • Input.java — add the content field (List<ReasoningContent>) to ReasoningItem, including the builder constructor, so reasoning items deserialize correctly.
  • Input.java — annotate the abstract Item base class with @JsonIgnoreProperties(ignoreUnknown = true); inherited by all output item subtypes, this guards against future unknown API fields.
  • Response.java — same annotation on the top-level Response (root deserialization target).
  • pom.xml — bump version to 3.22.3.

Notes

ignoreUnknown only affects deserialization, so outbound request serialization is unchanged.

@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant