diff options
Diffstat (limited to 'policy-endpoints/src/main/java/org')
2 files changed, 5 insertions, 2 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlJacksonHandler.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlJacksonHandler.java index 0cab374f..f71aa90f 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlJacksonHandler.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlJacksonHandler.java @@ -20,6 +20,7 @@ package org.onap.policy.common.endpoints.http.server; +import com.google.gson.GsonBuilder; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @@ -40,7 +41,8 @@ public class YamlJacksonHandler extends YamlMessageBodyHandler { * Translator to be used. We want a GSON object that's configured the same way as it * is in {@link JacksonHandler}, so just get it from there. */ - private static final YamlJsonTranslator TRANS = new YamlJsonTranslator(new JacksonHandler().getGson()); + private static final YamlJsonTranslator TRANS = + new YamlJsonTranslator(JacksonHandler.configBuilder(new GsonBuilder()).create()); /** * Constructs the object. diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlMessageBodyHandler.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlMessageBodyHandler.java index 89aa8ff6..8506a283 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlMessageBodyHandler.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/YamlMessageBodyHandler.java @@ -20,6 +20,7 @@ package org.onap.policy.common.endpoints.http.server; +import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import java.io.IOException; import java.io.InputStream; @@ -60,7 +61,7 @@ public class YamlMessageBodyHandler implements MessageBodyReader<Object>, Messag * from there. */ private static final YamlJsonTranslator DEFAULT_TRANSLATOR = - new YamlJsonTranslator(new GsonMessageBodyHandler().getGson()); + new YamlJsonTranslator(GsonMessageBodyHandler.configBuilder(new GsonBuilder()).create()); private final YamlJsonTranslator translator; |