Commit 28ac57d
committed
Fix HTTP method choice for index requests (#3221)
This commit fixes the selection of HTTP method for an index request based
on the presence of an explicilty set Id, or an Id value that can be inferred from
the document.
In the previous implementation, the IUrlParameter.GetString() method on the Id type
evaluated the Document to infer an Id from it, setting the internal Value of the Id to this
inferred value. As part of refactoring, this assignment was removed, which changes the
behaviour of the client when determining the HTTP method for an index request; in this
scenario, it is not enough to look to see if the Id type has a value, or that the Document is
not null, we need to know at this point that an Id can be inferred from the Document, and can
thereby send a PUT request.
An Id is inferred from the Document before the HTTP method is determined as part of resolving
RouteValues, so this commit changes the implementation to check if Id has a value, or
RouteValues.Id has a value.
(cherry picked from commit 948cbb1)1 parent 4aff53f commit 28ac57d
File tree
3 files changed
+7
-15
lines changed- src
- Nest
- CommonAbstractions/Infer/Id
- Document/Single/Index
- Tests/Document/Single/Index
3 files changed
+7
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 26 | + | |
32 | 27 | | |
| 28 | + | |
33 | 29 | | |
| 30 | + | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
| |||
0 commit comments