You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While digging into native image Jackson stuff I stumbled over ObjectMapper#setConstructorDetector(ConstructorDetector.USE_PROPERTIES_BASED) which seems to behave as you'd expect/want for single field classes out of the box, so no annotation needed for case class Example(singleField: String).
We'd need to investigate but seems convenient if it doesn't have any negatives for normal usage.
Interesting, we should make use of that somehow. Might be dangerous in a patch release, but we could make it an opt-in and document it. I haven't ready the article in detail, so don't know if we need to add anything.
In the end it turned out to be a problem specific to how the Scala Jackson module tries to figure things out and no annotation is actually needed. Maybe it is still needed and this is interesting for Java, not sure.
While digging into native image Jackson stuff I stumbled over
ObjectMapper#setConstructorDetector(ConstructorDetector.USE_PROPERTIES_BASED)
which seems to behave as you'd expect/want for single field classes out of the box, so no annotation needed forcase class Example(singleField: String)
.We'd need to investigate but seems convenient if it doesn't have any negatives for normal usage.
Source article: https://cowtowncoder.medium.com/jackson-2-12-most-wanted-3-5-246624e2d3d0
The text was updated successfully, but these errors were encountered: