contentType = XContentType.JSON;
}
XContentBuilder builder = new XContentBuilder(XContentFactory.xContent(contentType),
new BytesStreamOutput());
if (request.paramAsBoolean("pretty", false)) {
builder.prettyPrint().lfAtEnd();
}
String casing = request.param("case");
if (casing != null && "camelCase".equals(casing)) {
builder.fieldCaseConversion(XContentBuilder.FieldCaseConversion.CAMELCASE);
} else {