Browse Source

Fixes for API specification (#46522)

Follow-up of #42346
Tomas Della Vedova 6 years ago
parent
commit
a2a502b330

+ 1 - 1
rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json

@@ -1,7 +1,7 @@
 {
   "clear_scroll":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll",
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api",
       "description":"Explicitly clears the search context for a scroll."
     },
     "stability":"stable",

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json

@@ -39,7 +39,6 @@
             },
             "type":{
               "type":"string",
-              "required":false,
               "description":"The type of the document; deprecated and optional starting with 7.0",
               "deprecated":true
             }

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json

@@ -39,7 +39,6 @@
             },
             "type":{
               "type":"string",
-              "required":false,
               "description":"The type of the document; deprecated and optional starting with 7.0",
               "deprecated":true
             }

+ 0 - 2
rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json

@@ -16,12 +16,10 @@
           "parts": {
             "index": {
               "type": "string",
-              "required": true,
               "description": "The name of the source index to clone"
             },
             "target": {
               "type": "string",
-              "required": true,
               "description": "The name of the target index to clone into"
             }
           }

+ 1 - 1
rest-api-spec/src/main/resources/rest-api-spec/api/info.json

@@ -1,7 +1,7 @@
 {
   "info":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/",
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html",
       "description":"Returns basic information about the cluster."
     },
     "stability":"stable",

+ 10 - 20
rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json

@@ -32,58 +32,48 @@
     "params":{
       "ids":{
         "type":"list",
-        "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body",
-        "required":false
+        "description":"A comma-separated list of documents ids. You must define ids as parameter or set \"ids\" or \"docs\" in the request body"
       },
       "term_statistics":{
         "type":"boolean",
         "description":"Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "default":false,
-        "required":false
+        "default":false
       },
       "field_statistics":{
         "type":"boolean",
         "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "default":true,
-        "required":false
+        "default":true
       },
       "fields":{
         "type":"list",
-        "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "required":false
+        "description":"A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"."
       },
       "offsets":{
         "type":"boolean",
         "description":"Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "default":true,
-        "required":false
+        "default":true
       },
       "positions":{
         "type":"boolean",
         "description":"Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "default":true,
-        "required":false
+        "default":true
       },
       "payloads":{
         "type":"boolean",
         "description":"Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "default":true,
-        "required":false
+        "default":true
       },
       "preference":{
         "type":"string",
-        "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "required":false
+        "description":"Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"."
       },
       "routing":{
         "type":"string",
-        "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\".",
-        "required":false
+        "description":"Specific routing value. Applies to all returned documents unless otherwise specified in body \"params\" or \"docs\"."
       },
       "realtime":{
         "type":"boolean",
-        "description":"Specifies if requests are real-time as opposed to near-real-time (default: true).",
-        "required":false
+        "description":"Specifies if requests are real-time as opposed to near-real-time (default: true)."
       },
       "version":{
         "type":"number",

+ 1 - 1
rest-api-spec/src/main/resources/rest-api-spec/api/ping.json

@@ -1,7 +1,7 @@
 {
   "ping":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/",
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html",
       "description":"Returns whether the cluster is running."
     },
     "stability":"stable",

+ 1 - 1
rest-api-spec/src/main/resources/rest-api-spec/api/render_search_template.json

@@ -1,7 +1,7 @@
 {
   "render_search_template":{
     "documentation":{
-      "url":"http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html",
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html#_validating_templates",
       "description":"Allows to use the Mustache language to pre-render a search definition."
     },
     "stability":"stable",

+ 4 - 2
rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.cleanup_repository.json

@@ -1,6 +1,9 @@
 {
   "snapshot.cleanup_repository": {
-    "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html",
+    "documentation": {
+      "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html",
+      "description": "Removes stale data from repository."
+    },
     "stability": "stable",
     "url": {
       "paths": [
@@ -12,7 +15,6 @@
           "parts": {
             "repository": {
               "type": "string",
-              "required" : true,
               "description": "A repository name"
             }
           }

+ 9 - 18
rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json

@@ -43,52 +43,43 @@
       "term_statistics":{
         "type":"boolean",
         "description":"Specifies if total term frequency and document frequency should be returned.",
-        "default":false,
-        "required":false
+        "default":false
       },
       "field_statistics":{
         "type":"boolean",
         "description":"Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned.",
-        "default":true,
-        "required":false
+        "default":true
       },
       "fields":{
         "type":"list",
-        "description":"A comma-separated list of fields to return.",
-        "required":false
+        "description":"A comma-separated list of fields to return."
       },
       "offsets":{
         "type":"boolean",
         "description":"Specifies if term offsets should be returned.",
-        "default":true,
-        "required":false
+        "default":true
       },
       "positions":{
         "type":"boolean",
         "description":"Specifies if term positions should be returned.",
-        "default":true,
-        "required":false
+        "default":true
       },
       "payloads":{
         "type":"boolean",
         "description":"Specifies if term payloads should be returned.",
-        "default":true,
-        "required":false
+        "default":true
       },
       "preference":{
         "type":"string",
-        "description":"Specify the node or shard the operation should be performed on (default: random).",
-        "required":false
+        "description":"Specify the node or shard the operation should be performed on (default: random)."
       },
       "routing":{
         "type":"string",
-        "description":"Specific routing value.",
-        "required":false
+        "description":"Specific routing value."
       },
       "realtime":{
         "type":"boolean",
-        "description":"Specifies if request is real-time as opposed to near-real-time (default: true).",
-        "required":false
+        "description":"Specifies if request is real-time as opposed to near-real-time (default: true)."
       },
       "version":{
         "type":"number",

+ 8 - 2
x-pack/plugin/src/test/resources/rest-api-spec/api/slm.delete_lifecycle.json

@@ -1,7 +1,7 @@
 {
   "slm.delete_lifecycle":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html"
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete.html"
     },
     "stability":"stable",
     "url":{
@@ -10,7 +10,13 @@
           "path":"/_slm/policy/{policy_id}",
           "methods":[
             "DELETE"
-          ]
+          ],
+          "parts":{
+            "policy_id":{
+              "type":"string",
+              "description":"The id of the snapshot lifecycle policy to remove"
+            }
+          }
         }
       ]
     },

+ 1 - 1
x-pack/plugin/src/test/resources/rest-api-spec/api/slm.execute_lifecycle.json

@@ -1,7 +1,7 @@
 {
   "slm.execute_lifecycle":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html"
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute.html"
     },
     "stability":"stable",
     "url":{

+ 1 - 1
x-pack/plugin/src/test/resources/rest-api-spec/api/slm.get_lifecycle.json

@@ -1,7 +1,7 @@
 {
   "slm.get_lifecycle":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html"
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get.html"
     },
     "stability":"stable",
     "url":{

+ 1 - 1
x-pack/plugin/src/test/resources/rest-api-spec/api/slm.put_lifecycle.json

@@ -1,7 +1,7 @@
 {
   "slm.put_lifecycle":{
     "documentation":{
-      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api.html"
+      "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put.html"
     },
     "stability":"stable",
     "url":{