Repository navigation
Resolve untyped values for POJO-shaped Map.Entry deserialization - #6370
Conversation
Map.Entry deserialization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove the constructor check rejecting raw types in MapEntryDeserializer and resolve missing key/value types as Object, so raw Map.Entry also works in natural shape and with property-level @jsonformat. Correct parameter order of POJOWrappedDeserializer copy constructor, which swapped key and value type deserializers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Resolving raw Map.Entry key and value types as Object across POJO and natural shapes could change decoded values or accept inputs previously rejected. Fixes raw ✅ 1 closed✅ Quality: New test uses a2q() instead of the text blocks the project prefers
VerificationRules No rules evaluated Functional validation Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Fixes #6366.
The POJO-shaped entry deserializer already treats a missing key type as Object, but passes null to value-deserializer lookup for a raw Map.Entry. Resolve the value type with containedTypeOrUnknown too.
Raw
Map.Entryis now handled asMap.Entry<Object,Object>in all shapes. This also changes natural shape:MapEntryDeserializerno longer rejects raw types with "Missing generic type information", and resolves missing key and value types as Object. As a result, property-level@JsonFormat(shape = POJO)and@JsonFormat(shape = NATURAL)work on raw entries too.Also corrects the parameter order of the
POJOWrappedDeserializercopy constructor, which swapped the key and value type deserializers. This had no effect so far because both fields are always null.Adds regression tests for raw entries with scalar and structured contents, a POJO mix-in, typed-value coercion, natural shape, both property-level formats and the constructor parameter order.