Records to/from JSON
Brian Goetz
brian.goetz at oracle.com
Thu May 7 21:52:04 UTC 2020
That glass is indeed half full.
Another glass that is half full: the story of how legacy annotations on
record components are "pushed down" to where legacy frameworks expect
them, and everything just works. She was able to solve her problem by
putting annotations on the record components, without having to
redeclare any of the members. If Jackson gets better later, that's
great, but even without that, this is success.
On 5/7/2020 5:35 PM, Alex Buckley wrote:
> On 5/7/2020 1:27 PM, Brian Goetz wrote:
>> There's a nice writeup of using records with Jackson here:
>>
>> https://angiejones.tech/?p=5434
>
> I cringed when I saw `@JsonProperty` annotations duplicating the
> record component names (shades of `@PathParam("id") String id;` from
> JAX-RS) but it seems like the Jackson team is on its way to not
> needing them.
>
> A critical issue for the Jackson team seems to be detecting that a
> class is a record without using `Class::isRecord`, because it doesn't
> exist on Java 8. Multi-Release JARs, documented in JEP 238, would help
> Jackson here.
>
> Alex
More information about the amber-dev
mailing list