aboutsummaryrefslogtreecommitdiffstats
path: root/profiles
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-03-05 06:35:52 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-05 06:35:52 +0000
commit7fd4e74500eaf8d684f615495f7debddc146b888 (patch)
tree188e48cdf8dae87a820fd5688a74e6123d501fbc /profiles
parentee6c134312bff3506f4f7eca695dad7d0dfec2d9 (diff)
parentcf1ab5db1033e403dfc839d5fbbe0580be1d497b (diff)
Merge "Resolved JsonElement issue for grpc server and other classes"
Diffstat (limited to 'profiles')
-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