-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Search before asking
- I searched in the issues and found nothing similar.
Describe the bug
Issue : Implement forward reference resolution for array-based deserialization
Summary
Jackson currently supports forward reference resolution (via @JsonIdentityInfo / Object Ids) for:
- POJOs (bean properties)
- Collections (CollectionDeserializer)
- Maps (MapDeserializer)
However, forward references are not supported for arrays like Object[].
When a forward reference appears inside an array, Jackson throws UnresolvedForwardReference instead of deferring the resolution as it does for collections.
This issue proposes adding forward-reference support to ObjectArrayDeserializer.
Motivation
Object arrays are a common data structure, especially in legacy models, binary formats, and auto-generated schemas.
Users expect forward references to behave consistently across:
List / Map / Object[]
Fields / nested structures
Mixed resolved + unresolved elements
The current behavior is inconsistent:
{
"items": [
{ "id": 1 },
{ "@ref": 1 }
]
}
Works if items is a List
Fails if items is a T[]
This discrepancy forces developers to rewrite model classes or avoid arrays.
Version Information
2.14.1
Reproduction
<-- Any of the following
- Brief code sample/snippet: include here in preformatted/code section
- Longer example stored somewhere else (diff repo, snippet), add a link
- Textual explanation: include here
-->
// Your code here