From 4c702798b1fb2aebca7a1471b00cddbef678db2f Mon Sep 17 00:00:00 2001 From: Dulanjali Dilmi Date: Sun, 18 Feb 2024 10:30:27 +0530 Subject: [PATCH] Update github actions --- .../java/org/apache/synapse/mediators/elementary/Target.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Target.java b/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Target.java index 1887073f9c..2c9cd6ed01 100644 --- a/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Target.java +++ b/modules/core/src/main/java/org/apache/synapse/mediators/elementary/Target.java @@ -527,8 +527,8 @@ private String removeJSONFromString(MessageContext synCtx, String inputString, S if (path.equals("$") || path.equals("$.")) { result = ""; } else { - Object list = JsonPath.compile(path).read(result); - if (!((JsonArray) list).isEmpty()) { + JsonElement list = JsonPath.parse(result).read(path); + if (!(list instanceof JsonArray) || !((JsonArray) list).isEmpty()) { DocumentContext doc = JsonPath.parse(result); doc.delete(path); result = doc.jsonString();