|
@@ -28,6 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
|
|
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
|
|
import org.elasticsearch.common.xcontent.ObjectParser;
|
|
|
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
|
|
+import org.elasticsearch.common.xcontent.ToXContentObject;
|
|
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
|
import org.elasticsearch.common.xcontent.XContentHelper;
|
|
|
import org.elasticsearch.common.xcontent.XContentParser;
|
|
@@ -47,7 +48,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
|
|
import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken;
|
|
|
|
|
|
/** Response object for {@link GetFieldMappingsRequest} API */
|
|
|
-public class GetFieldMappingsResponse extends ActionResponse implements ToXContentFragment {
|
|
|
+public class GetFieldMappingsResponse extends ActionResponse implements ToXContentObject {
|
|
|
|
|
|
private static final ParseField MAPPINGS = new ParseField("mappings");
|
|
|
|
|
@@ -111,6 +112,7 @@ public class GetFieldMappingsResponse extends ActionResponse implements ToXConte
|
|
|
|
|
|
@Override
|
|
|
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
|
|
+ builder.startObject();
|
|
|
for (Map.Entry<String, Map<String, Map<String, FieldMappingMetaData>>> indexEntry : mappings.entrySet()) {
|
|
|
builder.startObject(indexEntry.getKey());
|
|
|
builder.startObject(MAPPINGS.getPreferredName());
|
|
@@ -126,6 +128,7 @@ public class GetFieldMappingsResponse extends ActionResponse implements ToXConte
|
|
|
builder.endObject();
|
|
|
builder.endObject();
|
|
|
}
|
|
|
+ builder.endObject();
|
|
|
return builder;
|
|
|
}
|
|
|
|