Skip to content

Commit

Permalink
Fixes for the REST specification (#51791)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
karmi authored Feb 2, 2020
1 parent ed170cc commit 050c4d4
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,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":{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"enrich.delete_policy": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-delete-policy.html",
"documentation": {
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html"
},
"stability" : "stable",
"url": {
"paths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"enrich.execute_policy": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-execute-policy.html",
"documentation": {
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html"
},
"stability" : "stable",
"url": {
"paths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"enrich.get_policy": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html",
"documentation": {
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html"
},
"stability" : "stable",
"url": {
"paths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"enrich.put_policy": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-put-policy.html",
"documentation": {
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html"
},
"stability" : "stable",
"url": {
"paths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"enrich.stats": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats.html",
"documentation": {
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html"
},
"stability" : "stable",
"url": {
"paths": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"sql.clear_cursor":{
"documentation":{
"url":"Clear SQL cursor"
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html",
"description":"Clears the SQL cursor"
},
"stability":"stable",
"url":{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"sql.query":{
"documentation":{
"url":"Execute SQL"
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html",
"description":"Executes an SQL request"
},
"stability":"stable",
"url":{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"sql.translate":{
"documentation":{
"url":"Translate SQL into Elasticsearch queries"
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html",
"description":"Translates SQL into Elasticsearch queries"
},
"stability":"stable",
"url":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ teardown:

- do:
license.get:
accept_enterprise: "true"
accept_enterprise: true

## a v5 license object has 12 attributes
- length: { license: 12 }
Expand All @@ -41,7 +41,7 @@ teardown:

- do:
license.get:
accept_enterprise: "false"
accept_enterprise: false

## a v4 license object has 11 attributes
- length: { license: 11 }
Expand Down

0 comments on commit 050c4d4

Please sign in to comment.