diff --git a/java/json-transform/build.gradle b/java/json-transform/build.gradle index 0d5a299..b67b8bd 100644 --- a/java/json-transform/build.gradle +++ b/java/json-transform/build.gradle @@ -9,7 +9,7 @@ plugins { } group 'co.nlighten' -version = '0.2.3' +version = '0.2.4' ext { gsonVersion = "2.10.1" diff --git a/java/json-transform/src/main/java/co/nlighten/jsontransform/functions/TransformerFunctionFlatten.java b/java/json-transform/src/main/java/co/nlighten/jsontransform/functions/TransformerFunctionFlatten.java index bd336c6..1e3c90c 100644 --- a/java/json-transform/src/main/java/co/nlighten/jsontransform/functions/TransformerFunctionFlatten.java +++ b/java/json-transform/src/main/java/co/nlighten/jsontransform/functions/TransformerFunctionFlatten.java @@ -59,7 +59,7 @@ private JE flatten(JE source, JO target, String prefix, String arrayPrefix) { for (var i = 0; i < size; i++) { flatten(adapter.jArray.get(ja, i), target, (prefix == null ? "" : (prefix + ".")) + arrayPrefix + i, arrayPrefix); } - } else { + } else if (prefix != null) { adapter.jObject.add(target, prefix, ja); } } else {