summaryrefslogtreecommitdiffstats
path: root/profiles/http
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/http')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java13
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/utils/OnapCommandHttpUtils.java2
2 files changed, 12 insertions, 3 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
index 973c4ae1..43772e56 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java
@@ -133,9 +133,18 @@ public class OnapCommandSchemaHttpLoader {
cmd.getInput().setReqQueries(query);
break;
case OnapCommandHttpConstants.CONTEXT:
- Map<String, String> context = (Map<String, String>) map.get(key2);
+ Map<String, Object> context = (Map<String, Object>) map.get(key2);
+
+ for (String key: context.keySet()) {
+ switch (key) {
+ case OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES:
+ Boolean flag = (Boolean) context.get(OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES);
+ cmd.getInput().getContext().put(OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES, flag.toString());
+ break;
+ }
+ }
+
- cmd.getInput().getContext().putAll(context);
break;
case OnapCommandHttpConstants.MULTIPART_ENTITY_NAME:
Object multipartEntityName = map.get(key2);
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 43a80181..b77b85da 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
@@ -89,7 +89,7 @@ public class OnapCommandHttpUtils {
boolean isRemoveEmptyNodes = Boolean.parseBoolean(input.getContext().getOrDefault(OnapCommandHttpConstants.CONTEXT_REMOVE_EMPTY_JSON_NODES, "false"));
if (isRemoveEmptyNodes) {
- input.setBody(OnapCommandHttpUtils.normalizeJson(input.getBody()));
+ inp.setBody(OnapCommandHttpUtils.normalizeJson(input.getBody()));
}
return inp;