summaryrefslogtreecommitdiffstats
path: root/aai-core/src/main/java
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-08-19 16:17:03 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-08-19 16:33:11 +0200
commite98fe40ba47af72eb26d11722d3bba16da374cc8 (patch)
tree8240529cc29a6d16a13bffa182aee2885e1d62f1 /aai-core/src/main/java
parentd2a63fcf3c5ee6b8363cc9db87706b2491c7aeb0 (diff)
Update spring-boot to 2.5 in aai-common
- update spring-boot (2.4 -> 2.5.15) - update vulnerable dependencies (spring-jms) - remove old codehaus.jackson dependency Issue-ID: AAI-3972 Change-Id: Ie0854c192a3a7bb719e9ac0e080e83a48e1b964a Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-core/src/main/java')
-rw-r--r--aai-core/src/main/java/org/onap/aai/util/PojoUtils.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/util/PojoUtils.java b/aai-core/src/main/java/org/onap/aai/util/PojoUtils.java
index f974ba14..4c2ce942 100644
--- a/aai-core/src/main/java/org/onap/aai/util/PojoUtils.java
+++ b/aai-core/src/main/java/org/onap/aai/util/PojoUtils.java
@@ -27,6 +27,7 @@ import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import com.google.common.base.CaseFormat;
import com.google.common.collect.Multimap;
@@ -124,12 +125,15 @@ public class PojoUtils {
*/
public <T> String getJsonFromObject(T clazz, boolean wrapRoot, boolean indent)
throws JsonGenerationException, JsonMappingException, IOException {
- ObjectMapper mapper = JsonMapper.builder().serializationInclusion(JsonInclude.Include.NON_NULL)
+ ObjectMapper mapper = JsonMapper.builder()
+ .addModule(new JaxbAnnotationModule())
+ .addModule(new JavaTimeModule())
+ .serializationInclusion(JsonInclude.Include.NON_NULL)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(SerializationFeature.INDENT_OUTPUT, indent)
.configure(SerializationFeature.WRAP_ROOT_VALUE, wrapRoot)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
- .configure(DeserializationFeature.UNWRAP_ROOT_VALUE, wrapRoot).addModule(new JaxbAnnotationModule())
+ .configure(DeserializationFeature.UNWRAP_ROOT_VALUE, wrapRoot)
.build();
return mapper.writeValueAsString(clazz);