Trying to fix the issue with descendant operator

This commit is contained in:
Marcin Grzejszczak
2023-04-27 14:42:33 +02:00
parent f03106da61
commit c29bd77521

View File

@@ -163,7 +163,6 @@ class JsonToJsonPathsConverter {
containsOnlyEmptyElements(object)
&& isNotRootArray(matcherPath)) {
String pathToDelete = pathToDelete(pathWithoutAnyArray)
context.delete(pathToDelete)
if (pathToDelete.contains(DESCENDANT_OPERATOR)) {
Object root = context.read('$')
if (rootContainsEmptyContainers(root)) {
@@ -172,6 +171,8 @@ class JsonToJsonPathsConverter {
return false
}
return false
} else {
context.delete(pathToDelete)
}
return removeTrailingContainers(pathToDelete, context)
}