Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-17009 json.wrf parameter ignored in JacksonJsonWriter (#1980)

Alex D204ff1ddb7d3
diff --git a/solr/core/src/java/org/apache/solr/response/JacksonJsonWriter.java b/solr/core/src/java/org/apache/solr/response/JacksonJsonWriter.java
index 79b09ae3bf4..611223fd216 100644
--- a/solr/core/src/java/org/apache/solr/response/JacksonJsonWriter.java
+++ b/solr/core/src/java/org/apache/solr/response/JacksonJsonWriter.java
@@ -19,6 +19,7 @@ package org.apache.solr.response;
import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.util.DefaultIndenter;
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
import java.io.IOException;
import java.io.OutputStream;
@@ -34,7 +35,8 @@ public class JacksonJsonWriter extends BinaryResponseWriter {
protected static final DefaultPrettyPrinter pretty =
new DefaultPrettyPrinter()
.withoutSpacesInObjectEntries()
- .withArrayIndenter(DefaultPrettyPrinter.NopIndenter.instance);
+ .withArrayIndenter(DefaultPrettyPrinter.NopIndenter.instance)
+ .withObjectIndenter(new DefaultIndenter().withLinefeed("\n"));
public JacksonJsonWriter() {
super();