summaryrefslogtreecommitdiffstats
path: root/common-app-api/src/main/java/org
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-02-09 19:00:35 +0000
committerMichael Morris <michael.morris@est.tech>2022-03-11 15:25:28 +0000
commitf13f58eb867c763e6ed1c3b674fd99b1081a0664 (patch)
treec0ccc70b8fdf4362bce26efa0a5bb1c435f98575 /common-app-api/src/main/java/org
parent767b122ea026099e17a2ffde30e6718d2abf150f (diff)
Support complex types in interface operation inputs
Issue-ID: SDC-3897 Change-Id: Ieac2d74ad340de1d9f6e4cd3ac830e2ec8c35d5b Signed-off-by: andre.schmid <andre.schmid@est.tech> Signed-off-by: vasraz <vasyl.razinkov@est.tech> Signed-off-by: MichaelMorris <michael.morris@est.tech>
Diffstat (limited to 'common-app-api/src/main/java/org')
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java b/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java
index 6ee4984b9f..be534d2909 100644
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java
+++ b/common-app-api/src/main/java/org/openecomp/sdc/common/util/JsonUtils.java
@@ -47,8 +47,15 @@ public class JsonUtils {
return json.entrySet().isEmpty();
}
- public static boolean isEmptyJson(JsonElement json) {
- return json.isJsonPrimitive() ? false : JsonUtils.isEmptyJson(json.getAsJsonObject());
+ public static boolean isEmptyJson(final JsonElement json) {
+ if (json.isJsonArray()) {
+ return json.getAsJsonArray().isEmpty();
+ }
+ if (json.isJsonObject()) {
+ return JsonUtils.isEmptyJson(json.getAsJsonObject());
+ }
+
+ return false;
}
public static boolean isJsonNullOrEmpty(JsonObject json) {