Skip to content

Commit

Permalink
Mappings: Fix Get field mapping api with pretty flag
Browse files Browse the repository at this point in the history
Fix two review comments

Closes elastic#6552
  • Loading branch information
johtani committed Dec 8, 2014
1 parent dd58d10 commit 75bd751
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Expand Up @@ -20,7 +20,6 @@
package org.elasticsearch.rest.action.admin.indices.mapping.get;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse.FieldMappingMetaData;
Expand All @@ -29,7 +28,6 @@
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.*;
import org.elasticsearch.rest.action.support.RestBuilderListener;
Expand Down Expand Up @@ -82,8 +80,7 @@ public RestResponse buildResponse(GetFieldMappingsResponse response, XContentBui
status = NOT_FOUND;
}
builder.startObject();
Map<String, String> param = Maps.newHashMap();
response.toXContent(builder, new ToXContent.DelegatingMapParams(param, request));
response.toXContent(builder, request);
builder.endObject();
return new BytesRestResponse(status, builder);
}
Expand Down
Expand Up @@ -166,7 +166,6 @@ public void simpleGetFieldMappingsWithPretty() throws Exception {

assertTrue(responseStrings.contains("\"mapping\" : {\n"));

// pretty=false
params.put("pretty", "false");

response = client().admin().indices().prepareGetFieldMappings("index").setTypes("type").setFields("field1","obj.subfield").get();
Expand Down

0 comments on commit 75bd751

Please sign in to comment.