Lloyd McKenzie 2024-10-02 22:40:13 -06:00
parent 53ec745184
commit 17ac205210
1 changed files with 20 additions and 4 deletions

View File

@ -833,10 +833,26 @@ public class JsonParser extends ParserBase {
} else if (!done.contains(child.getName())) { } else if (!done.contains(child.getName())) {
done.add(child.getName()); done.add(child.getName());
List<Element> list = e.getChildrenByName(child.getName()); List<Element> list = e.getChildrenByName(child.getName());
if (child.getProperty().getDefinition().hasExtension(ToolingExtensions.EXT_JSON_PROP_KEY)) boolean skipList = false;
composeKeyList(path, list); if (json.canElide() && isElideElements()) {
else boolean foundNonElide = false;
composeList(path, list); for (Element listElement: list) {
if (!listElement.isElided()) {
foundNonElide = true;
break;
}
}
if (!foundNonElide) {
json.elide();
skipList = true;
}
}
if (!skipList) {
if (child.getProperty().getDefinition().hasExtension(ToolingExtensions.EXT_JSON_PROP_KEY))
composeKeyList(path, list);
else
composeList(path, list);
}
} }
} }
} }