Skip to content

Commit 4430f99

Browse files
authored
Documents the new deprecations options on the rest-api-spec (#41444)
* Documents the new deprecations options on the rest-api-spec Relates #41439 #38613 #35262 * remove reference to path now that #41452 is merged, also fixed missing a comma rendering the example json invalid * removed one more instance of path * make sure json examples are self contained and not excerpts
1 parent 897b24e commit 4430f99

File tree

1 file changed

+72
-1
lines changed

1 file changed

+72
-1
lines changed

rest-api-spec/README.markdown

+72-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Example for the ["Create Index"](http://www.elastic.co/guide/en/elasticsearch/re
1212
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html",
1313
"methods": ["PUT", "POST"],
1414
"url": {
15-
"path": "/{index}",
1615
"paths": ["/{index}"],
1716
"parts": {
1817
"index": {
@@ -46,6 +45,78 @@ The specification contains:
4645
The `methods` and `url.paths` elements list all possible HTTP methods and URLs for the endpoint;
4746
it is the responsibility of the developer to use this information for a sensible API on the target platform.
4847

48+
## Backwards compatibility
49+
50+
The specification follows the same backward compatibility guarantees as Elasticsearch.
51+
52+
- Within a Major, additions only.
53+
- If an item has been documented wrong it should be deprecated instead as removing these might break downstream clients.
54+
- Major version change, may deprecate pieces or simply remove them given enough deprecation time.
55+
56+
## Deprecations
57+
58+
The spec allows for deprecations of:
59+
60+
#### Entire API:
61+
62+
```json
63+
{
64+
"api" : {
65+
"documentation": "...",
66+
"deprecated" : {
67+
"version" : "7.0.0",
68+
"description" : "Reason API is being deprecated"
69+
},
70+
}
71+
}
72+
```
73+
74+
#### Specific paths:
75+
76+
```json
77+
{
78+
"api": {
79+
"documentation": "",
80+
"url": {
81+
"paths": ["/_monitoring/bulk"],
82+
"deprecated_paths" : [
83+
{
84+
"version" : "7.0.0",
85+
"path" : "/_monitoring/{type}/bulk",
86+
"description" : "Specifying types in urls has been deprecated"
87+
}
88+
]
89+
}
90+
}
91+
}
92+
```
93+
94+
Here `paths` describes the preferred paths and `deprecated_paths` indicates `paths` that will still work but are now
95+
deprecated.
96+
97+
#### Parameters
98+
99+
```json
100+
{
101+
"api": {
102+
"documentation": "",
103+
"methods": ["GET"],
104+
"url": {
105+
"params": {
106+
"stored_fields": {
107+
"type": "list",
108+
"description" : "",
109+
"deprecated" : {
110+
"version" : "7.0.0",
111+
"description" : "Reason parameter is being deprecated"
112+
}
113+
}
114+
}
115+
}
116+
}
117+
}
118+
```
119+
49120
## License
50121

51122
This software is licensed under the Apache License, version 2 ("ALv2").

0 commit comments

Comments
 (0)