From 98deb76d9292b23ec148d603a54576ed320d75c2 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Mon, 18 Feb 2019 16:29:38 +0100 Subject: [PATCH 1/5] fix #35262 define deprecations of API's as a whole and urls --- .../resources/rest-api-spec/api/count.json | 9 +++- .../resources/rest-api-spec/api/create.json | 9 +++- .../resources/rest-api-spec/api/delete.json | 9 +++- .../rest-api-spec/api/delete_by_query.json | 9 +++- .../resources/rest-api-spec/api/exists.json | 9 +++- .../rest-api-spec/api/exists_source.json | 9 +++- .../resources/rest-api-spec/api/explain.json | 9 +++- .../main/resources/rest-api-spec/api/get.json | 9 +++- .../rest-api-spec/api/get_source.json | 9 +++- .../resources/rest-api-spec/api/index.json | 14 ++++++- .../api/indices.exists_type.json | 4 ++ .../api/indices.get_field_mapping.json | 14 ++++++- .../api/indices.get_mapping.json | 14 ++++++- .../api/indices.put_mapping.json | 41 ++++++++++++++++++- .../api/indices.validate_query.json | 9 +++- .../resources/rest-api-spec/api/mget.json | 9 +++- .../resources/rest-api-spec/api/msearch.json | 9 +++- .../rest-api-spec/api/msearch_template.json | 9 +++- .../rest-api-spec/api/mtermvectors.json | 9 +++- .../resources/rest-api-spec/api/search.json | 9 +++- .../rest-api-spec/api/search_template.json | 9 +++- .../rest-api-spec/api/termvectors.json | 15 ++++++- .../resources/rest-api-spec/api/update.json | 9 +++- .../rest-api-spec/api/update_by_query.json | 9 +++- .../rest-api-spec/api/graph.explore.json | 9 +++- .../rest-api-spec/api/monitoring.bulk.json | 9 +++- .../api/rollup.rollup_search.json | 9 +++- 27 files changed, 263 insertions(+), 28 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/count.json b/rest-api-spec/src/main/resources/rest-api-spec/api/count.json index d14f4ab784a57..64759fcd6a0e8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/count.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/count.json @@ -4,7 +4,14 @@ "methods": ["POST", "GET"], "url": { "path": "/_count", - "paths": ["/_count", "/{index}/_count", "/{index}/{type}/_count"], + "paths": ["/_count", "/{index}/_count"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_count", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json index 6a21620423d6b..35dfc1684d66f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json @@ -4,7 +4,14 @@ "methods": ["PUT","POST"], "url": { "path": "/{index}/_create/{id}", - "paths": ["/{index}/_create/{id}", "/{index}/{type}/{id}/_create"], + "paths": ["/{index}/_create/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}/_create", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json index 4b698b371a16d..ca0720eb802d9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json @@ -4,7 +4,14 @@ "methods": ["DELETE"], "url": { "path": "/{index}/_doc/{id}", - "paths": ["/{index}/{type}/{id}", "/{index}/_doc/{id}"], + "paths": ["/{index}/_doc/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", 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 dfdc00680828f..3a829440e50a3 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 @@ -4,7 +4,14 @@ "methods": ["POST"], "url": { "path": "/{index}/_delete_by_query", - "paths": ["/{index}/_delete_by_query", "/{index}/{type}/_delete_by_query"], + "paths": ["/{index}/_delete_by_query"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_delete_by_query", + "description" : "Specifying types in urls has been deprecated" + } + ], "comment": "most things below this are just copied from search.json", "parts": { "index": { diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json index 1d3749a5d8c4f..5fb62c1c4510e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json @@ -4,7 +4,14 @@ "methods": ["HEAD"], "url": { "path": "/{index}/_doc/{id}", - "paths": ["/{index}/_doc/{id}", "/{index}/{type}/{id}"], + "paths": ["/{index}/_doc/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json index a3edff1d111a5..5a62b0ea21335 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json @@ -4,7 +4,14 @@ "methods": ["HEAD"], "url": { "path": "/{index}/_source/{id}", - "paths": ["/{index}/_source/{id}", "/{index}/{type}/{id}/_source"], + "paths": ["/{index}/_source/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}/_source", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json index 005cbadccb0b7..bc174f9f04024 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/{index}/_explain/{id}", - "paths": ["/{index}/_explain/{id}", "/{index}/{type}/{id}/_explain"], + "paths": ["/{index}/_explain/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}/_explain", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json index ac3024c9c245d..1dc2d720a91db 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json @@ -4,7 +4,14 @@ "methods": ["GET"], "url": { "path": "/{index}/_doc/{id}", - "paths": ["/{index}/_doc/{id}", "/{index}/{type}/{id}"], + "paths": ["/{index}/_doc/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json index cd737e32d6ca8..ad6069df7e745 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json @@ -4,7 +4,14 @@ "methods": ["GET"], "url": { "path": "/{index}/_source/{id}", - "paths": ["/{index}/_source/{id}", "/{index}/{type}/{id}/_source"], + "paths": ["/{index}/_source/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}/_source", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json index dcba05f6a3859..ff378d2313762 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json @@ -4,7 +4,19 @@ "methods": ["POST", "PUT"], "url": { "path": "/{index}/_doc", - "paths": ["/{index}/{type}", "/{index}/{type}/{id}", "/{index}/_doc/{id}", "/{index}/_doc"], + "paths": ["/{index}/_doc/{id}", "/{index}/_doc"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json index d793199bc2776..e00f2d915e7f7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json @@ -2,6 +2,10 @@ "indices.exists_type": { "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", "methods": ["HEAD"], + "deprecated" : { + "version" : "7.0", + "description" : "Types are being removed from elasticsearch and therefor this API is on the way out. Read more here: https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html" + }, "url": { "path": "/{index}/_mapping/{type}", "paths": ["/{index}/_mapping/{type}"], diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json index 3ce610153b5e6..bf999242aee7a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json @@ -4,7 +4,19 @@ "methods": ["GET"], "url": { "path": "/_mapping/field/{fields}", - "paths": ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}", "/_mapping/{type}/field/{fields}", "/{index}/_mapping/{type}/field/{fields}"], + "paths": ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/_mapping/{type}/field/{fields}", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/_mapping/{type}/field/{fields}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json index d9016ec402498..734cb4e29f18b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json @@ -4,7 +4,19 @@ "methods": ["GET"], "url": { "path": "/_mapping", - "paths": ["/_mapping", "/{index}/_mapping", "/_mapping/{type}", "/{index}/_mapping/{type}"], + "paths": ["/_mapping", "/{index}/_mapping"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/_mapping/{type}", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/_mapping/{type}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json index cc55ffccdd1ef..122499f308acc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json @@ -3,8 +3,45 @@ "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html", "methods": ["PUT", "POST"], "url": { - "path": "/{index}/{type}/_mapping", - "paths": ["/{index}/{type}/_mapping", "/{index}/_mapping/{type}", "/_mapping/{type}", "/{index}/{type}/_mappings", "/{index}/_mappings/{type}", "/_mappings/{type}", "{index}/_mappings", "{index}/_mapping"], + "path": "{index}/_mapping", + "paths": ["{index}/_mapping"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_mapping", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/_mapping/{type}", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/{type}/_mappings", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/_mappings/{type}", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/_mappings/{type}", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "{index}/_mappings", + "description" : "The plural mappings is accepted but only /_mapping is documented" + }, + { + "version" : "7.0", + "path" : "/_mapping/{type}", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json index 2f9aac054382c..48bc57143cf69 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_validate/query", - "paths": ["/_validate/query", "/{index}/_validate/query", "/{index}/{type}/_validate/query"], + "paths": ["/_validate/query", "/{index}/_validate/query"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_validate/query", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json index 62fbb59a4e451..7404019821a71 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_mget", - "paths": ["/_mget", "/{index}/_mget", "/{index}/{type}/_mget"], + "paths": ["/_mget", "/{index}/_mget"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_mget", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json index 398dcbd29515d..0e1e66228dc53 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_msearch", - "paths": ["/_msearch", "/{index}/_msearch", "/{index}/{type}/_msearch"], + "paths": ["/_msearch", "/{index}/_msearch"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_msearch", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json index e89f96e06960f..0678776542965 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_msearch/template", - "paths": ["/_msearch/template", "/{index}/_msearch/template", "/{index}/{type}/_msearch/template"], + "paths": ["/_msearch/template", "/{index}/_msearch/template"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_msearch/template", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json index 58978b7d190fa..8849a4bdcad59 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json @@ -4,7 +4,14 @@ "methods" : ["GET", "POST"], "url" : { "path" : "/_mtermvectors", - "paths" : ["/_mtermvectors", "/{index}/_mtermvectors", "/{index}/{type}/_mtermvectors"], + "paths" : ["/_mtermvectors", "/{index}/_mtermvectors"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_mtermvectors", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts" : { "index" : { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json index f44c0f74b2c3d..7ab3abd963bd7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_search", - "paths": ["/_search", "/{index}/_search", "/{index}/{type}/_search"], + "paths": ["/_search", "/{index}/_search"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_search", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json index 24b7fa135b331..e019d035491c9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_search/template", - "paths": ["/_search/template", "/{index}/_search/template", "/{index}/{type}/_search/template"], + "paths": ["/_search/template", "/{index}/_search/template"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_search/template", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json b/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json index 3485c7a6cc103..b8d261ed6c436 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json @@ -4,8 +4,19 @@ "methods" : ["GET", "POST"], "url" : { "path" : "/{index}/_termvectors/{id}", - "paths" : ["/{index}/_termvectors/{id}", "/{index}/_termvectors/", - "/{index}/{type}/{id}/_termvectors", "/{index}/{type}/_termvectors"], + "paths" : ["/{index}/_termvectors/{id}", "/{index}/_termvectors"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}/_termvectors", + "description" : "Specifying types in urls has been deprecated" + }, + { + "version" : "7.0", + "path" : "/{index}/{type}/_termvectors", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts" : { "index" : { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json index 106b29b252ad3..8eb0071f1f7a9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json @@ -4,7 +4,14 @@ "methods": ["POST"], "url": { "path": "/{index}/_update/{id}", - "paths": ["/{index}/_update/{id}", "/{index}/{type}/{id}/_update"], + "paths": ["/{index}/_update/{id}"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/{id}/_update", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "id": { "type": "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json index 427a7e04ad8fb..da1e276d65392 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json @@ -4,7 +4,14 @@ "methods": ["POST"], "url": { "path": "/{index}/_update_by_query", - "paths": ["/{index}/_update_by_query", "/{index}/{type}/_update_by_query"], + "paths": ["/{index}/_update_by_query"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_update_by_query", + "description" : "Specifying types in urls has been deprecated" + } + ], "comment": "most things below this are just copied from search.json", "parts": { "index": { diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json index 293694d0ae8a0..d7a307787b5c9 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/{index}/_graph/explore", - "paths": ["/{index}/_graph/explore", "/{index}/{type}/_graph/explore"], + "paths": ["/{index}/_graph/explore"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/{index}/{type}/_graph/explore", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts" : { "index": { "type" : "list", diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json index 55ce7b9ba6170..e4985df6ec4e7 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json @@ -4,7 +4,14 @@ "methods": ["POST", "PUT"], "url": { "path": "/_monitoring/bulk", - "paths": ["/_monitoring/bulk", "/_monitoring/{type}/bulk"], + "paths": ["/_monitoring/bulk"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/_monitoring/{type}/bulk", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "type": { "type" : "string", diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json index 5a63dfa3b42aa..0c14863013dad 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json @@ -4,7 +4,14 @@ "methods": [ "GET", "POST" ], "url": { "path": "/{index}/_rollup_search", - "paths": [ "{index}/_rollup_search", "{index}/{type}/_rollup_search" ], + "paths": [ "{index}/_rollup_search"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "{index}/{type}/_rollup_search", + "description" : "Specifying types in urls has been deprecated" + } + ], "parts": { "index": { "type": "list", From dfd9642b45e2da8bacc3dfe6411e9b1eb05b16d7 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Tue, 19 Feb 2019 13:44:12 +0100 Subject: [PATCH 2/5] document hot threads deprecated paths --- .../rest-api-spec/api/nodes.hot_threads.json | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json index 854cde1a9e731..342770b1bf91c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json @@ -4,7 +4,39 @@ "methods": ["GET"], "url": { "path": "/_nodes/hot_threads", - "paths": ["/_cluster/nodes/hotthreads", "/_cluster/nodes/hot_threads", "/_cluster/nodes/{node_id}/hotthreads", "/_cluster/nodes/{node_id}/hot_threads", "/_nodes/hotthreads", "/_nodes/hot_threads", "/_nodes/{node_id}/hotthreads", "/_nodes/{node_id}/hot_threads"], + "paths": ["/_nodes/hot_threads", "/_nodes/{node_id}/hot_threads"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/_cluster/nodes/hotthreads", + "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version" : "7.0", + "path" : "/_cluster/nodes/{node_id}/hotthreads", + "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version" : "7.0", + "path" : "/_nodes/hotthreads", + "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version" : "7.0", + "path" : "/_nodes/{node_id}/hotthreads", + "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" + }, + { + "version" : "7.0", + "path" : "/_cluster/nodes/hot_threads", + "description" : "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + }, + { + "version" : "7.0", + "path" :"/_cluster/nodes/{node_id}/hot_threads", + "description" : "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" + } + ], "parts": { "node_id": { "type" : "list", From d0f00cd604531b51fb27c749d7054f80835c527f Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Tue, 19 Feb 2019 16:03:03 +0100 Subject: [PATCH 3/5] deprecate scroll_id as part of the URL, documented only as part of the body which is a safer behaviour as well --- .../resources/rest-api-spec/api/clear_scroll.json | 11 +++++++++-- .../src/main/resources/rest-api-spec/api/scroll.json | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json b/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json index 6b82d1dc4742a..b3fc40b36ee23 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json @@ -3,8 +3,15 @@ "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html", "methods": ["DELETE"], "url": { - "path": "/_search/scroll/{scroll_id}", - "paths": ["/_search/scroll/{scroll_id}", "/_search/scroll"], + "path": "/_search/scroll", + "paths": [ "/_search/scroll"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/_search/scroll/{scroll_id}", + "description" : "A scroll id can be quite large and should be specified as part of the body" + } + ], "parts": { "scroll_id": { "type" : "list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json b/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json index fc04caeb808c5..663330cfc33fa 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json @@ -4,7 +4,14 @@ "methods": ["GET", "POST"], "url": { "path": "/_search/scroll", - "paths": ["/_search/scroll", "/_search/scroll/{scroll_id}"], + "paths": ["/_search/scroll"], + "deprecated_paths" : [ + { + "version" : "7.0", + "path" : "/_search/scroll/{scroll_id}", + "description" : "A scroll id can be quite large and should be specified as part of the body" + } + ], "parts": { "scroll_id": { "type" : "string", From 8fe223e081892b59c5f656bfa90f4d3f8ab111d5 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Mon, 4 Mar 2019 15:39:47 +0100 Subject: [PATCH 4/5] use version numbers up to patch version --- .../rest-api-spec/api/clear_scroll.json | 2 +- .../main/resources/rest-api-spec/api/count.json | 2 +- .../main/resources/rest-api-spec/api/create.json | 2 +- .../main/resources/rest-api-spec/api/delete.json | 2 +- .../rest-api-spec/api/delete_by_query.json | 2 +- .../main/resources/rest-api-spec/api/exists.json | 2 +- .../rest-api-spec/api/exists_source.json | 2 +- .../resources/rest-api-spec/api/explain.json | 2 +- .../main/resources/rest-api-spec/api/get.json | 2 +- .../resources/rest-api-spec/api/get_source.json | 2 +- .../main/resources/rest-api-spec/api/index.json | 4 ++-- .../rest-api-spec/api/indices.exists_type.json | 2 +- .../api/indices.get_field_mapping.json | 4 ++-- .../rest-api-spec/api/indices.get_mapping.json | 4 ++-- .../rest-api-spec/api/indices.put_mapping.json | 14 +++++++------- .../api/indices.validate_query.json | 2 +- .../main/resources/rest-api-spec/api/mget.json | 2 +- .../resources/rest-api-spec/api/msearch.json | 2 +- .../rest-api-spec/api/msearch_template.json | 2 +- .../rest-api-spec/api/mtermvectors.json | 2 +- .../rest-api-spec/api/nodes.hot_threads.json | 16 ++++++++-------- .../main/resources/rest-api-spec/api/scroll.json | 2 +- .../main/resources/rest-api-spec/api/search.json | 2 +- .../rest-api-spec/api/search_template.json | 2 +- .../resources/rest-api-spec/api/termvectors.json | 4 ++-- .../main/resources/rest-api-spec/api/update.json | 2 +- .../rest-api-spec/api/update_by_query.json | 2 +- .../rest-api-spec/api/graph.explore.json | 2 +- .../rest-api-spec/api/monitoring.bulk.json | 2 +- .../rest-api-spec/api/rollup.rollup_search.json | 2 +- 30 files changed, 47 insertions(+), 47 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json b/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json index b3fc40b36ee23..b2b0343230c66 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/clear_scroll.json @@ -7,7 +7,7 @@ "paths": [ "/_search/scroll"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_search/scroll/{scroll_id}", "description" : "A scroll id can be quite large and should be specified as part of the body" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/count.json b/rest-api-spec/src/main/resources/rest-api-spec/api/count.json index 64759fcd6a0e8..b933091b9a416 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/count.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/count.json @@ -7,7 +7,7 @@ "paths": ["/_count", "/{index}/_count"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_count", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json index 35dfc1684d66f..f21d2606364d1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_create/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}/_create", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json index ca0720eb802d9..792f9d89609bf 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_doc/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}", "description" : "Specifying types in urls has been deprecated" } 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 3a829440e50a3..37b88e0f24d93 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 @@ -7,7 +7,7 @@ "paths": ["/{index}/_delete_by_query"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_delete_by_query", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json index 5fb62c1c4510e..3debd3edce585 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_doc/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json index 5a62b0ea21335..89f9c33e5fb44 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_source/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}/_source", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json index bc174f9f04024..12aa7a8dca942 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_explain/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}/_explain", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json index 1dc2d720a91db..cc20ceecc4e4c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_doc/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json index ad6069df7e745..a26691edc41fc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get_source.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_source/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}/_source", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json index ff378d2313762..2a2053d2250a0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json @@ -7,12 +7,12 @@ "paths": ["/{index}/_doc/{id}", "/{index}/_doc"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json index e00f2d915e7f7..a788202c93ae2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json @@ -3,7 +3,7 @@ "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", "methods": ["HEAD"], "deprecated" : { - "version" : "7.0", + "version" : "7.0.0", "description" : "Types are being removed from elasticsearch and therefor this API is on the way out. Read more here: https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html" }, "url": { diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json index bf999242aee7a..305cb700ceae9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json @@ -7,12 +7,12 @@ "paths": ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_mapping/{type}/field/{fields}", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/_mapping/{type}/field/{fields}", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json index 734cb4e29f18b..abfc3d3867e9a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json @@ -7,12 +7,12 @@ "paths": ["/_mapping", "/{index}/_mapping"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_mapping/{type}", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/_mapping/{type}", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json index 122499f308acc..c46e6b15549cc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json @@ -7,37 +7,37 @@ "paths": ["{index}/_mapping"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_mapping", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/_mapping/{type}", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_mappings", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/_mappings/{type}", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_mappings/{type}", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "{index}/_mappings", "description" : "The plural mappings is accepted but only /_mapping is documented" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_mapping/{type}", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json index 48bc57143cf69..6f1395b1582a0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json @@ -7,7 +7,7 @@ "paths": ["/_validate/query", "/{index}/_validate/query"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_validate/query", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json index 7404019821a71..c04fb34beac18 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mget.json @@ -7,7 +7,7 @@ "paths": ["/_mget", "/{index}/_mget"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_mget", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json index 0e1e66228dc53..9c416e841362a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json @@ -7,7 +7,7 @@ "paths": ["/_msearch", "/{index}/_msearch"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_msearch", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json index 0678776542965..87aa6b22b8d45 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json @@ -7,7 +7,7 @@ "paths": ["/_msearch/template", "/{index}/_msearch/template"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_msearch/template", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json b/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json index 8849a4bdcad59..8cf4b22e90da9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json @@ -7,7 +7,7 @@ "paths" : ["/_mtermvectors", "/{index}/_mtermvectors"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_mtermvectors", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json index 342770b1bf91c..95df4f53aa579 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.hot_threads.json @@ -7,33 +7,33 @@ "paths": ["/_nodes/hot_threads", "/_nodes/{node_id}/hot_threads"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_cluster/nodes/hotthreads", "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_cluster/nodes/{node_id}/hotthreads", "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_nodes/hotthreads", "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_nodes/{node_id}/hotthreads", "description" : "The hot threads API accepts `hotthreads` but only `hot_threads` is documented" }, { - "version" : "7.0", - "path" : "/_cluster/nodes/hot_threads", + "version" : "7.0.0", + "path" : "/_cluster/nodes/hot_threads", "description" : "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" }, { - "version" : "7.0", - "path" :"/_cluster/nodes/{node_id}/hot_threads", + "version" : "7.0.0", + "path" :"/_cluster/nodes/{node_id}/hot_threads", "description" : "The hot accepts /_cluster/nodes as prefix for backwards compatibility reasons" } ], diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json b/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json index 663330cfc33fa..31e02a172fd0e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/scroll.json @@ -7,7 +7,7 @@ "paths": ["/_search/scroll"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_search/scroll/{scroll_id}", "description" : "A scroll id can be quite large and should be specified as part of the body" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json index 7ab3abd963bd7..00ed8d113a00c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json @@ -7,7 +7,7 @@ "paths": ["/_search", "/{index}/_search"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_search", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json index e019d035491c9..5395e4f59c10e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json @@ -7,7 +7,7 @@ "paths": ["/_search/template", "/{index}/_search/template"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_search/template", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json b/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json index b8d261ed6c436..44b972b355f68 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json @@ -7,12 +7,12 @@ "paths" : ["/{index}/_termvectors/{id}", "/{index}/_termvectors"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}/_termvectors", "description" : "Specifying types in urls has been deprecated" }, { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_termvectors", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json index 8eb0071f1f7a9..b85c70be57d9e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_update/{id}"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/{id}/_update", "description" : "Specifying types in urls has been deprecated" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json index da1e276d65392..bdb4c565bd965 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_update_by_query"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_update_by_query", "description" : "Specifying types in urls has been deprecated" } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json index d7a307787b5c9..b01c51bc6c381 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/graph.explore.json @@ -7,7 +7,7 @@ "paths": ["/{index}/_graph/explore"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/{index}/{type}/_graph/explore", "description" : "Specifying types in urls has been deprecated" } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json index e4985df6ec4e7..3d33cde654d4e 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/monitoring.bulk.json @@ -7,7 +7,7 @@ "paths": ["/_monitoring/bulk"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "/_monitoring/{type}/bulk", "description" : "Specifying types in urls has been deprecated" } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json index 0c14863013dad..0eeb7b29256cf 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json +++ b/x-pack/plugin/src/test/resources/rest-api-spec/api/rollup.rollup_search.json @@ -7,7 +7,7 @@ "paths": [ "{index}/_rollup_search"], "deprecated_paths" : [ { - "version" : "7.0", + "version" : "7.0.0", "path" : "{index}/{type}/_rollup_search", "description" : "Specifying types in urls has been deprecated" } From 430108a1434067d9d9929fef3ececd60d0087b32 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Mon, 8 Apr 2019 18:00:43 +0200 Subject: [PATCH 5/5] rest spec parser picks up deprecated paths as paths too --- .../ClientYamlSuiteRestApiParser.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java index fefd6e6a276c6..3c6216eed76ed 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java @@ -70,11 +70,16 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro } if (parser.currentToken() == XContentParser.Token.START_ARRAY && "paths".equals(currentFieldName)) { while (parser.nextToken() == XContentParser.Token.VALUE_STRING) { - String path = parser.text(); - if (restApi.getPaths().contains(path)) { - throw new IllegalArgumentException("Found duplicate path [" + path + "]"); + addPathToApi(parser.text(), restApi); + } + } + if (parser.currentToken() == XContentParser.Token.START_ARRAY && "deprecated_paths".equals(currentFieldName)) { + while (parser.nextToken() != XContentParser.Token.END_ARRAY) { + if (parser.currentToken() == XContentParser.Token.FIELD_NAME && "path".equals(parser.currentName())) + { + parser.nextToken(); + addPathToApi(parser.text(), restApi); } - restApi.addPath(path); } } @@ -142,6 +147,13 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro return restApi; } + private void addPathToApi(String path, ClientYamlSuiteRestApi restApi) { + if (restApi.getPaths().contains(path)) { + throw new IllegalArgumentException("Found duplicate path [" + path + "]"); + } + restApi.addPath(path); + } + private static class Parameter { private boolean required; public boolean isRequired() {