From f13f58eb867c763e6ed1c3b674fd99b1081a0664 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 9 Feb 2022 19:00:35 +0000 Subject: Support complex types in interface operation inputs Issue-ID: SDC-3897 Change-Id: Ieac2d74ad340de1d9f6e4cd3ac830e2ec8c35d5b Signed-off-by: andre.schmid Signed-off-by: vasraz Signed-off-by: MichaelMorris --- .../main/java/org/openecomp/sdc/common/util/JsonUtils.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'common-app-api/src/main/java/org') 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) { -- cgit 1.2.3-korg