I\'m a beginning java programmer, so I\'m sorry if my question is kind of dumb.
I have a JSON object that looks like this:
{ \"element1\" : { \"g
I haven't tested it, but you probably want something like this:
public static void stripEmpty(JsonNode node) { Iterator it = node.iterator(); while (it.hasNext()) { JsonNode child = it.next(); if (child.isObject() && child.isEmpty(null)) it.remove(); else stripEmpty(child); } }