From 6cc66cadc9db495883ce1211c1a0f712e77f8bc7 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Sat, 5 Oct 2024 21:17:10 +0200 Subject: Make Introspector serializable via Jackson - annotate Introspector, such that ObjectMapper can serialize it Issue-ID: AAI-4010 Signed-off-by: Fiete Ostkamp Change-Id: I4896f811fa9db0637c941a11b01f26b734b15a21 --- .../src/main/java/org/onap/aai/introspection/Introspector.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'aai-core/src/main') diff --git a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java index 87983d8d..cde99db4 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/Introspector.java @@ -20,6 +20,8 @@ package org.onap.aai.introspection; +import com.fasterxml.jackson.annotation.JsonRawValue; +import com.fasterxml.jackson.annotation.JsonValue; import com.google.common.base.CaseFormat; import java.io.UnsupportedEncodingException; @@ -620,6 +622,12 @@ public abstract class Introspector implements Cloneable { return marshal(properties); } + @JsonValue + @JsonRawValue + public String toString() { + return marshal(false); + } + public String makeSingular(String word) { String result = word; -- cgit 1.2.3-korg