From cf1ab5db1033e403dfc839d5fbbe0580be1d497b Mon Sep 17 00:00:00 2001 From: "priyanka.akhade" Date: Wed, 4 Mar 2020 14:21:12 +0000 Subject: Resolved JsonElement issue for grpc server and other classes Issue-ID: CLI-247 Signed-off-by: priyanka.akhade Change-Id: Ifcfba782ec6454f58d1df11e6ab7db3e1a04d17b --- .../main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'profiles/http') diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java b/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java index 0eb06c96..a592ac79 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java @@ -43,6 +43,8 @@ import org.slf4j.LoggerFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.PathNotFoundException; @@ -300,9 +302,10 @@ public class OnapCommandHttpUtils { } public static String normalizeJson(String json) throws OnapCommandHttpInvalidRequestBody { + JsonParser jsonParser = new JsonParser(); JsonElement node; try { - node = gson.fromJson(json,JsonElement.class); + node = jsonParser.parse(json); normalizeJson(node); return gson.toJson(node); } catch (Exception e) { //NOSONAR -- cgit 1.2.3-korg