aboutsummaryrefslogtreecommitdiffstats
path: root/profiles/http/src
diff options
context:
space:
mode:
authorpriyanka.akhade <priyanka.akhade@huawei.com>2020-03-04 14:21:12 +0000
committerpriyanka.akhade <priyanka.akhade@huawei.com>2020-03-04 14:21:12 +0000
commitcf1ab5db1033e403dfc839d5fbbe0580be1d497b (patch)
tree3396e8fc8e02ae17e457aa9212a1759e51d01641 /profiles/http/src
parent92d3092901ab1866766953e5f8d74bacf27bbc8f (diff)
Resolved JsonElement issue for grpc server and other classes
Issue-ID: CLI-247 Signed-off-by: priyanka.akhade <priyanka.akhade@huawei.com> Change-Id: Ifcfba782ec6454f58d1df11e6ab7db3e1a04d17b
Diffstat (limited to 'profiles/http/src')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java5
1 files changed, 4 insertions, 1 deletions
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