Jackson deserialize a date as Integer array in Local datetime/LocalDate

Viewed 26

I'm using Java 17, spring-boot 2.7.4 and it's related Spring dependencies.

I have a Kafka consumer that consumes an object representing a date as an Integer array as below:

{
    "date": [2022, 9, 21, 21, 28, 37, 9999999]
}

I understand that using spring boot I already have jackson-datatype-jsr310 in my classpath. When I use my ObjectMapper to deserialize the object it does not give me as a LocalDateTime. How can I achieve this? Do I have to write a custom LocalDateTime deserializer?

Plus, how can I use the embedded Kafka json deserializer in order to delegate the mapping that I'm doing manually?

0 Answers
Related