From 6cd319c18ed78fd5d9644a22ee0b20717a1677d0 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 29 Oct 2019 09:47:44 -0400 Subject: Disable HTML escaping in gson coders Issue-ID: POLICY-1869 Signed-off-by: Jim Hahn Change-Id: Ic757d3a8e7e0e3537ecba979a919b9ea3c1aa797 Signed-off-by: Jim Hahn --- .../main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java | 2 +- gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'gson/src/main/java/org/onap') diff --git a/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java b/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java index 37d24177..75d58f2f 100644 --- a/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java +++ b/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java @@ -85,7 +85,7 @@ public class GsonMessageBodyHandler implements MessageBodyReader, Messag * @return the configured builder */ public static GsonBuilder configBuilder(GsonBuilder builder) { - return builder.registerTypeAdapterFactory(new MapDoubleAdapterFactory()); + return builder.disableHtmlEscaping().registerTypeAdapterFactory(new MapDoubleAdapterFactory()); } @Override diff --git a/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java b/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java index 6df5ad2e..420fbdb2 100644 --- a/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java +++ b/gson/src/main/java/org/onap/policy/common/gson/JacksonHandler.java @@ -61,6 +61,7 @@ public class JacksonHandler extends GsonMessageBodyHandler { return builder.registerTypeAdapterFactory(new JacksonFieldAdapterFactory()) .registerTypeAdapterFactory(new JacksonMethodAdapterFactory()) .registerTypeAdapterFactory(new MapDoubleAdapterFactory()) - .setExclusionStrategies(new JacksonExclusionStrategy()); + .setExclusionStrategies(new JacksonExclusionStrategy()) + .disableHtmlEscaping(); } } -- cgit 1.2.3-korg