Document Property Introspection for Deserialization #3719
Replies: 4 comments 13 replies
-
Should we revisit the progress of the I'm just concerned about how this delay might impact the wider Jackson projects and usage. I believe many volunteers, myself included, are willing to contribute while trying best to create little overhead. cheers |
Beta Was this translation helpful? Give feedback.
-
Started writing: which -- I realized -- is more a background document, explaining process surrounding discovery of |
Beta Was this translation helpful? Give feedback.
-
Created #4515 as umbrella issue for actual work (I am feeling over-optimistic about getting to start this, right after releasing 2.17.1 any day now) |
Beta Was this translation helpful? Give feedback.
-
I think documentation side is sufficient; significant work completed for #4515. |
Beta Was this translation helpful? Give feedback.
-
(note: inspired by #2992)
Currently -- as of 2.15 development starting -- the Number ONE priority for me is to rewrite Property Introspection logic to tackle issues that stem from the problem of "regular" -- getter/setter/field based -- properties, and "creator" properties (arguments to Constructors and/or static Factory methods) -- are not properly linked. This results in cases where some handling does not work the way users would expect: specifically, annotations on Creator properties and non-Creator ("regular") properties are not linked the way they should. Or, in case of Property (re)Naming, some functionality does not work on certain properties (generally, Creator properties).
The fundamental reason for this is that the discovery (introspection) of "regular" and "creator" properties is handled by 2 mostly separate code paths: one that starts with "regular" properties, does some processing, and only then attempts to locate "creator" properties, linking information (like annotations) at the point when some processing has already been done.
Worse, there are two phases to creator discovery:
@JsonCreator
, or@JsonProperty
for parameters) constructors/factory methodsOf these, creators from (2) do not get their properties correctly linked to possible Field / Method based properties.
What needs to happen is that the order is changed a bit -- it should start with Creator (and Creator property) discovery, followed by "regular" property discovery, and mostly deferring handling until both have been properly collected and merged.
With this, a big bunch of open issues would be resolved: not the least ones affecting Java 17 Record types.
What I hope to do, next, is to outline how the processing works in detail: it is not possible to change the processing until understanding current flow and constraints -- some of types used (say,
BeanDescription
) are existing API types and cannot be changed in arbitrary ways -- whereas others are internal types.After some documentation effort I may have time to start refactoring things, or maybe others want to try out changes as well.
But first things first: documenting what actually happens as of today (2.14.x).
Beta Was this translation helpful? Give feedback.
All reactions