Skip to content

Commit 050c4d4

Browse files
authored
Fixes for the REST specification (#51791)
* REST: Test: Fix the `accept_enterprise` parameter for Get License API (#51527) The Get License API specifies the `accept_enterprise` parameter as a `boolean`: https://github.com/elastic/elasticsearch/blob/0ca5cb8cb636a4be9c36b8e38e565af66abc423b/x-pack/plugin/src/test/resources/rest-api-spec/api/license.get.json#L22-L27 In the test, a `string` is passed however, which makes the test compilation fail in the Go client. (cherry picked from commit e2a2169) * Fix the SQL API documentation in REST specification (#51534) This patch fixes the SQL REST API documentation to conform to the current schema. (cherry picked from commit c8b6a84) * Fix the "slices" parameter for the Delete By Query API in the REST specification (#51535) 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: elastic/go-elasticsearch#77 * Fix the Enrich API documentation in REST specification (#51528) This patch fixes the REST API documentation for the Enrich APIs to conform to the current schema. (cherry picked from commit 59f28f4)
1 parent ed170cc commit 050c4d4

File tree

10 files changed

+25
-12
lines changed

10 files changed

+25
-12
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@
178178
"description": "The throttle for this request in sub-requests per second. -1 means no throttle."
179179
},
180180
"slices": {
181-
"type": "number",
181+
"type": "number|auto",
182182
"default": 1,
183-
"description": "The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks."
183+
"description": "The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks."
184184
}
185185
},
186186
"body":{

x-pack/plugin/src/test/resources/rest-api-spec/api/enrich.delete_policy.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"enrich.delete_policy": {
3-
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-delete-policy.html",
3+
"documentation": {
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html"
5+
},
46
"stability" : "stable",
57
"url": {
68
"paths": [

x-pack/plugin/src/test/resources/rest-api-spec/api/enrich.execute_policy.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"enrich.execute_policy": {
3-
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-execute-policy.html",
3+
"documentation": {
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html"
5+
},
46
"stability" : "stable",
57
"url": {
68
"paths": [

x-pack/plugin/src/test/resources/rest-api-spec/api/enrich.get_policy.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"enrich.get_policy": {
3-
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html",
3+
"documentation": {
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html"
5+
},
46
"stability" : "stable",
57
"url": {
68
"paths": [

x-pack/plugin/src/test/resources/rest-api-spec/api/enrich.put_policy.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"enrich.put_policy": {
3-
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-put-policy.html",
3+
"documentation": {
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html"
5+
},
46
"stability" : "stable",
57
"url": {
68
"paths": [

x-pack/plugin/src/test/resources/rest-api-spec/api/enrich.stats.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"enrich.stats": {
3-
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats.html",
3+
"documentation": {
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html"
5+
},
46
"stability" : "stable",
57
"url": {
68
"paths": [

x-pack/plugin/src/test/resources/rest-api-spec/api/sql.clear_cursor.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"sql.clear_cursor":{
33
"documentation":{
4-
"url":"Clear SQL cursor"
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html",
5+
"description":"Clears the SQL cursor"
56
},
67
"stability":"stable",
78
"url":{

x-pack/plugin/src/test/resources/rest-api-spec/api/sql.query.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"sql.query":{
33
"documentation":{
4-
"url":"Execute SQL"
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html",
5+
"description":"Executes an SQL request"
56
},
67
"stability":"stable",
78
"url":{

x-pack/plugin/src/test/resources/rest-api-spec/api/sql.translate.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"sql.translate":{
33
"documentation":{
4-
"url":"Translate SQL into Elasticsearch queries"
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html",
5+
"description":"Translates SQL into Elasticsearch queries"
56
},
67
"stability":"stable",
78
"url":{

x-pack/plugin/src/test/resources/rest-api-spec/test/license/30_enterprise_license.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ teardown:
2929

3030
- do:
3131
license.get:
32-
accept_enterprise: "true"
32+
accept_enterprise: true
3333

3434
## a v5 license object has 12 attributes
3535
- length: { license: 12 }
@@ -41,7 +41,7 @@ teardown:
4141

4242
- do:
4343
license.get:
44-
accept_enterprise: "false"
44+
accept_enterprise: false
4545

4646
## a v4 license object has 11 attributes
4747
- length: { license: 11 }

0 commit comments

Comments
 (0)