Skip to content

Commit be00a10

Browse files
masseykeCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 40a8524 commit be00a10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/simulate.ingest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"merge_type":{
4343
"type":"string",
4444
"description":"The mapping merge type if mapping overrides are being provided in mapping_addition, index_template_substitutions, or component_template_substitutions. The allowed values are one of index or template. The index option merges mappings the way they would be merged into an existing index. The template option merges mappings the way they would be merged into a template.",
45-
"default": "mapping_update"
45+
"default": "index"
4646
}
4747
},
4848
"body":{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private MapperService.MergeReason getMergeReason(String mergeType) {
176176
return Optional.ofNullable(mergeType).map(type -> switch (type) {
177177
case "index" -> MapperService.MergeReason.MAPPING_UPDATE;
178178
case "template" -> MapperService.MergeReason.INDEX_TEMPLATE;
179-
default -> throw new IllegalArgumentException("Unsupported merge type " + mergeType);
179+
default -> throw new IllegalArgumentException("Unsupported merge type '" + mergeType + "'. Valid values are 'index' and 'template'.");
180180
}).orElse(MapperService.MergeReason.MAPPING_UPDATE);
181181
}
182182

0 commit comments

Comments
 (0)