From 8a7023c0c084a5f2a3ee5640da329b6e6e07a7ee Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 28 Jan 2020 15:20:58 +0100 Subject: [PATCH] Fix the "slices" parameter for the Delete By Query API in the REST specification This patch updates the `type` parameter in the Delete By Query API: according to [the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html#docs-delete-by-query-slice), it can be set to "auto", but the type in the documentation allows only numerical values. This prevents people from setting the parameter to "auto" eg. in the Go client, which generates source from the specification, and sets the corresponding Go type as number. The patch uses the `|` notation, which we have discussed previously for encoding a "polymorphic" parameter like this. Related: https://github.com/elastic/go-elasticsearch/issues/77 --- .../src/main/resources/rest-api-spec/api/delete_by_query.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json index 0f2e14a336ff3..06da40bf04117 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json @@ -173,9 +173,9 @@ "description":"The throttle for this request in sub-requests per second. -1 means no throttle." }, "slices":{ - "type":"number", + "type":"number|auto", "default":1, - "description":"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." + "description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks." } }, "body":{