Skip to content

Add/support forward reference resolution for array values #5413

@RoiSoleil

Description

@RoiSoleil

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

  1. Brief code sample/snippet: include here in preformatted/code section
  2. Longer example stored somewhere else (diff repo, snippet), add a link
  3. Textual explanation: include here
    -->
// Your code here

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.x

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions