Skip to content

Conversation

@RoiSoleil
Copy link
Contributor

This commit adds full forward-reference support to ObjectArrayDeserializer, mirroring the behavior already available for CollectionDeserializer.

  • Introduces ObjectArrayReferring and ObjectArrayReferringAccumulator
  • Catches UnresolvedForwardReference during element deserialization
  • Defers unresolved elements and resolves them once the target id is available
  • Ensures final array construction comes from the accumulator when used
  • Adds comprehensive unit tests validating forward reference handling

Fixes: #5413

@cowtowncoder
Copy link
Member

@RoiSoleil Wow. Looks great so far!

One and only process thing, before I can merge this (with another code review or so), is that we need CLA (unless we already have one; I don't think we do but let me know if you have sent one before).
It's from here:

https://github.com/FasterXML/jackson/blob/main/contributor-agreement.pdf

and the usual way is to print the doc, fill & sign, scan/photo, email to "cla" at fasterxml dot com.

Once we have it, CLA is good for all future contributions.

Thank you once again for the very quick PR, including test. This seems like a good addition.

This commit adds full forward-reference support to
ObjectArrayDeserializer,
mirroring the behavior already available for CollectionDeserializer.

- Introduces ObjectArrayReferring and ObjectArrayReferringAccumulator
- Catches UnresolvedForwardReference during element deserialization
- Defers unresolved elements and resolves them once the target id is
available
- Ensures final array construction comes from the accumulator when used
- Adds comprehensive unit tests validating forward reference handling

Fixes: #5413
@RoiSoleil
Copy link
Contributor Author

@RoiSoleil Wow. Looks great so far!

One and only process thing, before I can merge this (with another code review or so), is that we need CLA (unless we already have one; I don't think we do but let me know if you have sent one before). It's from here:

https://github.com/FasterXML/jackson/blob/main/contributor-agreement.pdf

and the usual way is to print the doc, fill & sign, scan/photo, email to "cla" at fasterxml dot com.

Once we have it, CLA is good for all future contributions.

Thank you once again for the very quick PR, including test. This seems like a good addition.

I’ve just sent the email with the signed PDF attached. Let me know if you need anything else.

@cowtowncoder cowtowncoder added the cla-received PR already covered by CLA (optional label) label Nov 21, 2025
@cowtowncoder
Copy link
Member

Refactored things a bit, merging now. Thank you again @RoiSoleil !!!

@cowtowncoder cowtowncoder merged commit 7e81ee7 into FasterXML:3.x Nov 23, 2025
6 checks passed
@RoiSoleil
Copy link
Contributor Author

Do you think this could be cherry-pick in 2.x branch ?

@cowtowncoder
Copy link
Member

cowtowncoder commented Nov 23, 2025

@RoiSoleil I don't think so since since Java packages are different (files renamed 2.x -> 3.x), unfortunately.

So would need to re-create into new PR from this one, semi-manually (can start with copy-pasting, but some class names differ; exceptions). I can help if you wanted to try that?

@RoiSoleil
Copy link
Contributor Author

This is done in : #5425

@cowtowncoder
Copy link
Member

The other PR now merged.

@RoiSoleil
Copy link
Contributor Author

Thx !

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

Labels

cla-received PR already covered by CLA (optional label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add/support forward reference resolution for array values

2 participants