Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 14 records json serialization

Currently experimenting with the Records implements from java 14, everything looks nice but since the accessors are slightly different and jackson is not being able to deserialize and giving the following error:

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.x.x.x.xTracking and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

I checked all around the internet, including jackson and gson github to check the jep 359 support but havent found a single comment. Am i missing something really straight forward?

Yes i am aware that the java 14 is still not released and that records is only in preview in this version but would expect some comments at least.

like image 512
curiousdev Avatar asked Jul 25 '26 06:07

curiousdev


1 Answers

Records support was added to Jackson 2.12.0 (https://github.com/FasterXML/jackson-future-ideas/issues/46). It will be released in the next days.

like image 184
Eduard Wirch Avatar answered Jul 26 '26 20:07

Eduard Wirch