-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate types in get_source and exist_source (#36426)
This change adds a new untyped endpoint `{index}/_source/{id}` for both the GET and the HEAD methods to get the source of a document or check for its existance. It also adds deprecation warnings to RestGetSourceAction that emit a warning when the old deprecated "type" parameter is still used. Also updating documentation and tests where appropriate. Relates to #35190
- Loading branch information
Christoph Büscher
authored
Dec 17, 2018
1 parent
f0f2b26
commit 2f5300e
Showing
25 changed files
with
393 additions
and
44 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
8 changes: 5 additions & 3 deletions
8
rest-api-spec/src/main/resources/rest-api-spec/test/get_source/10_basic.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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
--- | ||
"Basic": | ||
|
||
- skip: | ||
version: " - 6.99.99" | ||
reason: types are required in requests before 7.0.0 | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { "foo": "bar" } | ||
|
||
- do: | ||
get_source: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
|
||
- match: { '': { foo: bar } } | ||
|
||
- do: | ||
get_source: | ||
index: test_1 | ||
type: _all | ||
id: 1 | ||
|
||
- match: { '': { foo: bar } } |
17 changes: 17 additions & 0 deletions
17
rest-api-spec/src/main/resources/rest-api-spec/test/get_source/11_basic_with_types.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,17 @@ | ||
--- | ||
"Basic with types": | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { "foo": "bar" } | ||
|
||
- do: | ||
get_source: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
|
||
- match: { '': { foo: bar } } |
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
16 changes: 16 additions & 0 deletions
16
...pi-spec/src/main/resources/rest-api-spec/test/get_source/16_default_values_with_types.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,16 @@ | ||
--- | ||
"Default values": | ||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
body: { "foo": "bar" } | ||
|
||
- do: | ||
get_source: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
|
||
- match: { '': { foo: bar } } |
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
42 changes: 42 additions & 0 deletions
42
rest-api-spec/src/main/resources/rest-api-spec/test/get_source/41_routing_with_types.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,42 @@ | ||
--- | ||
"Routing": | ||
|
||
|
||
- do: | ||
indices.create: | ||
index: test_1 | ||
body: | ||
settings: | ||
index: | ||
number_of_shards: 5 | ||
number_of_routing_shards: 5 | ||
number_of_replicas: 0 | ||
|
||
- do: | ||
cluster.health: | ||
wait_for_status: green | ||
|
||
- do: | ||
index: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
routing: 5 | ||
body: { foo: bar } | ||
|
||
- do: | ||
get_source: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
routing: 5 | ||
|
||
- match: { '': {foo: bar}} | ||
|
||
- do: | ||
catch: missing | ||
get_source: | ||
index: test_1 | ||
type: test | ||
id: 1 | ||
|
Oops, something went wrong.