From 3398e12c72b2f4f713fb5744d0674d413effb02f Mon Sep 17 00:00:00 2001 From: "MSI\\joaly" Date: Tue, 11 Nov 2025 09:09:53 -0400 Subject: [PATCH] update JsonHelper to serialize/deserialize LocalDateTime fields --- pom.xml | 5 +++++ .../banesco/common/infraestructure/helpers/JsonHelper.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index 5f1c7fe..a587def 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,11 @@ jaxb-runtime ${jakarta.jaxb.impl.version} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.17.1 + diff --git a/src/main/java/com/banesco/common/infraestructure/helpers/JsonHelper.java b/src/main/java/com/banesco/common/infraestructure/helpers/JsonHelper.java index 1315bb0..c931239 100644 --- a/src/main/java/com/banesco/common/infraestructure/helpers/JsonHelper.java +++ b/src/main/java/com/banesco/common/infraestructure/helpers/JsonHelper.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; public class JsonHelper { @@ -20,6 +21,8 @@ public class JsonHelper { static { MAPPER.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + MAPPER.registerModule(new JavaTimeModule()); + MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } /**