-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize underscore requirements in parameters
Stardardize underscore requirements in parameters across different type of requests: _index, _type, _source, _id keep their underscores params like version and retry_on_conflict will be without underscores In 6.x these parameters are deprecated and produce deprecated warnings. BulkRequest, MultiGetRequest, TermVectorcRequest, MoreLikeThisQuery were changed Closes #26886
- Loading branch information
1 parent
f3cdf8d
commit b1c4450
Showing
3 changed files
with
94 additions
and
41 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/60_deprecated.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
--- | ||
"Deprecated parameters should produce warning in Bulk query": | ||
# MODIFY in 7.x as these throw errors instead of warnings | ||
|
||
- skip: | ||
version: " - 6.99.99" | ||
reason: some parameters are deprecated starting from 7.0, their equivalents without underscore are used instead | ||
features: "warnings" | ||
|
||
- do: | ||
bulk: | ||
body: | | ||
{ "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_version": 1 } } | ||
{ "doc": { "f1": "v1" } } | ||
{ "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2", "_version": 1 } } | ||
{ "doc": { "f1": "v2" } } | ||
warnings: | ||
- "Deprecated field [_version] used, expected [version] instead" | ||
|
||
- do: | ||
bulk: | ||
body: | | ||
{ "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_routing": "test1" } } | ||
{ "doc": { "f1": "v1" } } | ||
{ "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2", "_routing": "test1" } } | ||
{ "doc": { "f1": "v2" } } | ||
warnings: | ||
- "Deprecated field [_routing] used, expected [routing] instead" |
64 changes: 64 additions & 0 deletions
64
rest-api-spec/src/main/resources/rest-api-spec/test/mget/80_deprecated.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
--- | ||
"Deprecated parameters should produce warning in Multi Get query": | ||
# MODIFY in 7.x as these throw errors instead of warnings | ||
|
||
- skip: | ||
version: " - 6.99.99" | ||
reason: some parameters are deprecated starting from 7.0, their equivalents without underscore are used instead | ||
features: "warnings" | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { foo: bar } | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 2 | ||
body: { foo: baz } | ||
|
||
- do: | ||
mget: | ||
body: | ||
docs: | ||
- { _index: test_1, _type: test, _id: 1, _routing : test1 } | ||
- { _index: test_1, _type: test, _id: 2, _routing : test1 } | ||
warnings: | ||
- "Deprecated field [_routing] used, expected [routing] instead" | ||
|
||
--- | ||
"Deprecated parameters should produce warning in Multi Get query2": | ||
# MODIFY in 7.x as these throw errors instead of warnings | ||
|
||
- skip: | ||
version: " - 6.99.99" | ||
reason: some parameters are deprecated starting from 7.0, their equivalents without underscore are used instead | ||
features: "warnings" | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { foo: bar } | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 2 | ||
body: { foo: baz } | ||
|
||
- do: | ||
mget: | ||
body: | ||
docs: | ||
- { _index: test_1, _type: test, _id: 1, _version : 1 } | ||
- { _index: test_1, _type: test, _id: 2, _version : 1 } | ||
warnings: | ||
- "Deprecated field [_version] used, expected [version] instead" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters