diff --git a/solr/solrj/src/java/org/apache/solr/common/util/Utils.java b/solr/solrj/src/java/org/apache/solr/common/util/Utils.java index c05ce233f0b..86bef9177c8 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/Utils.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/Utils.java @@ -234,13 +234,14 @@ public class Utils { startObject(); final boolean[] first = new boolean[1]; first[0] = true; + int sz = mapWriter._size(); mapWriter._forEachEntry((k, v) -> { if (first[0]) { first[0] = false; } else { writeValueSeparator(); } - indent(); + if (sz > 1) indent(); writeString(k.toString()); writeNameSeparator(); write(v);