Skip to content

Commit 85b9dc1

Browse files
committed
fix #35262 define deprecations of API's as a whole and urls (#39063)
* fix #35262 define deprecations of API's as a whole and urls * document hot threads deprecated paths * deprecate scroll_id as part of the URL, documented only as part of the body which is a safer behaviour as well * use version numbers up to patch version * rest spec parser picks up deprecated paths as paths too (cherry picked from commit 7e06023)
1 parent d8a2970 commit 85b9dc1

31 files changed

+329
-36
lines changed

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html",
44
"methods": ["DELETE"],
55
"url": {
6-
"path": "/_search/scroll/{scroll_id}",
7-
"paths": ["/_search/scroll/{scroll_id}", "/_search/scroll"],
6+
"path": "/_search/scroll",
7+
"paths": [ "/_search/scroll"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/_search/scroll/{scroll_id}",
12+
"description" : "A scroll id can be quite large and should be specified as part of the body"
13+
}
14+
],
815
"parts": {
916
"scroll_id": {
1017
"type" : "list",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["POST", "GET"],
55
"url": {
66
"path": "/_count",
7-
"paths": ["/_count", "/{index}/_count", "/{index}/{type}/_count"],
7+
"paths": ["/_count", "/{index}/_count"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_count",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"index": {
1017
"type" : "list",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["PUT","POST"],
55
"url": {
66
"path": "/{index}/_create/{id}",
7-
"paths": ["/{index}/_create/{id}", "/{index}/{type}/{id}/_create"],
7+
"paths": ["/{index}/_create/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}/_create",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["DELETE"],
55
"url": {
66
"path": "/{index}/_doc/{id}",
7-
"paths": ["/{index}/{type}/{id}", "/{index}/_doc/{id}"],
7+
"paths": ["/{index}/_doc/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["POST"],
55
"url": {
66
"path": "/{index}/_delete_by_query",
7-
"paths": ["/{index}/_delete_by_query", "/{index}/{type}/_delete_by_query"],
7+
"paths": ["/{index}/_delete_by_query"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_delete_by_query",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"comment": "most things below this are just copied from search.json",
916
"parts": {
1017
"index": {

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["HEAD"],
55
"url": {
66
"path": "/{index}/_doc/{id}",
7-
"paths": ["/{index}/_doc/{id}", "/{index}/{type}/{id}"],
7+
"paths": ["/{index}/_doc/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["HEAD"],
55
"url": {
66
"path": "/{index}/_source/{id}",
7-
"paths": ["/{index}/_source/{id}", "/{index}/{type}/{id}/_source"],
7+
"paths": ["/{index}/_source/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}/_source",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET", "POST"],
55
"url": {
66
"path": "/{index}/_explain/{id}",
7-
"paths": ["/{index}/_explain/{id}", "/{index}/{type}/{id}/_explain"],
7+
"paths": ["/{index}/_explain/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}/_explain",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET"],
55
"url": {
66
"path": "/{index}/_doc/{id}",
7-
"paths": ["/{index}/_doc/{id}", "/{index}/{type}/{id}"],
7+
"paths": ["/{index}/_doc/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET"],
55
"url": {
66
"path": "/{index}/_source/{id}",
7-
"paths": ["/{index}/_source/{id}", "/{index}/{type}/{id}/_source"],
7+
"paths": ["/{index}/_source/{id}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/{id}/_source",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"id": {
1017
"type" : "string",

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

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
"methods": ["POST", "PUT"],
55
"url": {
66
"path": "/{index}/_doc",
7-
"paths": ["/{index}/{type}", "/{index}/{type}/{id}", "/{index}/_doc/{id}", "/{index}/_doc"],
7+
"paths": ["/{index}/_doc/{id}", "/{index}/_doc"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}",
12+
"description" : "Specifying types in urls has been deprecated"
13+
},
14+
{
15+
"version" : "7.0.0",
16+
"path" : "/{index}/{type}/{id}",
17+
"description" : "Specifying types in urls has been deprecated"
18+
}
19+
],
820
"parts": {
921
"id": {
1022
"type" : "string",

rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"indices.exists_type": {
33
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html",
44
"methods": ["HEAD"],
5+
"deprecated" : {
6+
"version" : "7.0.0",
7+
"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"
8+
},
59
"url": {
610
"path": "/{index}/_mapping/{type}",
711
"paths": ["/{index}/_mapping/{type}"],

rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_field_mapping.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
"methods": ["GET"],
55
"url": {
66
"path": "/_mapping/field/{fields}",
7-
"paths": ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}", "/_mapping/{type}/field/{fields}", "/{index}/_mapping/{type}/field/{fields}"],
7+
"paths": ["/_mapping/field/{fields}", "/{index}/_mapping/field/{fields}"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/_mapping/{type}/field/{fields}",
12+
"description" : "Specifying types in urls has been deprecated"
13+
},
14+
{
15+
"version" : "7.0.0",
16+
"path" : "/{index}/_mapping/{type}/field/{fields}",
17+
"description" : "Specifying types in urls has been deprecated"
18+
}
19+
],
820
"parts": {
921
"index": {
1022
"type" : "list",

rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
"methods": ["GET"],
55
"url": {
66
"path": "/_mapping",
7-
"paths": ["/_mapping", "/{index}/_mapping", "/_mapping/{type}", "/{index}/_mapping/{type}"],
7+
"paths": ["/_mapping", "/{index}/_mapping"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/_mapping/{type}",
12+
"description" : "Specifying types in urls has been deprecated"
13+
},
14+
{
15+
"version" : "7.0.0",
16+
"path" : "/{index}/_mapping/{type}",
17+
"description" : "Specifying types in urls has been deprecated"
18+
}
19+
],
820
"parts": {
921
"index": {
1022
"type" : "list",

rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json

+39-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,45 @@
33
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html",
44
"methods": ["PUT", "POST"],
55
"url": {
6-
"path": "/{index}/{type}/_mapping",
7-
"paths": ["/{index}/{type}/_mapping", "/{index}/_mapping/{type}", "/_mapping/{type}", "/{index}/{type}/_mappings", "/{index}/_mappings/{type}", "/_mappings/{type}", "{index}/_mappings", "{index}/_mapping"],
6+
"path": "{index}/_mapping",
7+
"paths": ["{index}/_mapping"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_mapping",
12+
"description" : "Specifying types in urls has been deprecated"
13+
},
14+
{
15+
"version" : "7.0.0",
16+
"path" : "/{index}/_mapping/{type}",
17+
"description" : "Specifying types in urls has been deprecated"
18+
},
19+
{
20+
"version" : "7.0.0",
21+
"path" : "/{index}/{type}/_mappings",
22+
"description" : "Specifying types in urls has been deprecated"
23+
},
24+
{
25+
"version" : "7.0.0",
26+
"path" : "/{index}/_mappings/{type}",
27+
"description" : "Specifying types in urls has been deprecated"
28+
},
29+
{
30+
"version" : "7.0.0",
31+
"path" : "/_mappings/{type}",
32+
"description" : "Specifying types in urls has been deprecated"
33+
},
34+
{
35+
"version" : "7.0.0",
36+
"path" : "{index}/_mappings",
37+
"description" : "The plural mappings is accepted but only /_mapping is documented"
38+
},
39+
{
40+
"version" : "7.0.0",
41+
"path" : "/_mapping/{type}",
42+
"description" : "Specifying types in urls has been deprecated"
43+
}
44+
],
845
"parts": {
946
"index": {
1047
"type" : "list",

rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET", "POST"],
55
"url": {
66
"path": "/_validate/query",
7-
"paths": ["/_validate/query", "/{index}/_validate/query", "/{index}/{type}/_validate/query"],
7+
"paths": ["/_validate/query", "/{index}/_validate/query"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_validate/query",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"index": {
1017
"type" : "list",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET", "POST"],
55
"url": {
66
"path": "/_mget",
7-
"paths": ["/_mget", "/{index}/_mget", "/{index}/{type}/_mget"],
7+
"paths": ["/_mget", "/{index}/_mget"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_mget",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"index": {
1017
"type" : "string",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET", "POST"],
55
"url": {
66
"path": "/_msearch",
7-
"paths": ["/_msearch", "/{index}/_msearch", "/{index}/{type}/_msearch"],
7+
"paths": ["/_msearch", "/{index}/_msearch"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_msearch",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"index": {
1017
"type" : "list",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods": ["GET", "POST"],
55
"url": {
66
"path": "/_msearch/template",
7-
"paths": ["/_msearch/template", "/{index}/_msearch/template", "/{index}/{type}/_msearch/template"],
7+
"paths": ["/_msearch/template", "/{index}/_msearch/template"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_msearch/template",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts": {
916
"index": {
1017
"type" : "list",

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
"methods" : ["GET", "POST"],
55
"url" : {
66
"path" : "/_mtermvectors",
7-
"paths" : ["/_mtermvectors", "/{index}/_mtermvectors", "/{index}/{type}/_mtermvectors"],
7+
"paths" : ["/_mtermvectors", "/{index}/_mtermvectors"],
8+
"deprecated_paths" : [
9+
{
10+
"version" : "7.0.0",
11+
"path" : "/{index}/{type}/_mtermvectors",
12+
"description" : "Specifying types in urls has been deprecated"
13+
}
14+
],
815
"parts" : {
916
"index" : {
1017
"type" : "string",

0 commit comments

Comments
 (0)