Skip to content

Commit 744c75d

Browse files
authored
[Rest Api Compatibility] Rename BulkItemResponse.Failure type field (#74937)
it should return type instead of _type relates #51816
1 parent 2ec84a5 commit 744c75d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

modules/reindex/build.gradle

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,19 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
164164
}
165165
}
166166
}
167+
tasks.named("transformV7RestTests").configure({ task ->
168+
task.addAllowedWarningRegex("\\[types removal\\].*")
169+
})
170+
171+
def v7compatiblityNotSupportedTests = {
172+
return [
173+
'reindex/20_validation/reindex without source gives useful error message', // exception with a type. Not much benefit adding _doc there.
174+
'update_by_query/20_validation/update_by_query without source gives useful error message' // exception with a type. Not much benefit adding _doc there.
175+
]
176+
}
167177

168178
tasks.named("yamlRestCompatTest").configure {
169-
systemProperty 'tests.rest.blacklist', [
170-
/*type related failures */
171-
'reindex/20_validation/reindex without source gives useful error message',
172-
'reindex/85_scripting/Reindex all docs with one doc deletion',
173-
'delete_by_query/10_basic/Response for version conflict (seq no powered)',
174-
'update_by_query/10_basic/Response for version conflict (seq no powered)',
175-
'update_by_query/20_validation/update_by_query without source gives useful error message'
176-
].join(',')
179+
systemProperty 'tests.rest.blacklist', v7compatiblityNotSupportedTests().join(',')
177180
}
178181

179182
tasks.named('splitPackagesAudit').configure {

server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public boolean isAborted() {
319319
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
320320
builder.field(INDEX_FIELD, index);
321321
if (builder.getRestApiVersion() == RestApiVersion.V_7) {
322-
builder.field(MapperService.TYPE_FIELD_NAME, MapperService.SINGLE_MAPPING_NAME);
322+
builder.field("type", MapperService.SINGLE_MAPPING_NAME);
323323
}
324324
if (id != null) {
325325
builder.field(ID_FIELD, id);

0 commit comments

Comments
 (0)