You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
::::{dropdown} Improvements to the optional `body` property
20
+
::::{dropdown} Changes to the optional body property
21
21
22
22
In 8.x, every API function had a `body` property that would provide a place to put arbitrary values that should go in the HTTP request body, even if they were not noted in the specification or documentation. In 9.0, each API function still includes an optional `body` property, but TypeScript's type checker will disallow properties that should go in the root of the object. A `querystring` parameter has also been added that behaves the same as `body`, but inserts its values into the request querystring.
23
23
24
-
Also, the logic for where each parameter should be added to an API HTTP request has been updated:
24
+
**Impact**<br> Some adjustments to API calls may be necessary for code that used a `body` property 8.x, especially to appease the TypeScript type checker, but it should not have any impact on any code that was not using a `body` property.
25
+
26
+
**Action**<br> Check existing code for use of the `body` property, and move any properties that should be in the root object according to the API function's request type definition. If using TypeScript, the TypeScript type checker will surface most of these issues for you.
27
+
::::
28
+
29
+
::::{dropdown} Changes to API parameter collation into an HTTP request
30
+
31
+
The logic for where each parameter in an API function call should be added to its HTTP request has been updated:
25
32
26
33
1. If recognized as a `body` parameter according to the Elasticsearch specification, put it in the JSON body
27
34
2. If recognized as a `path` parameter, put it in the URL path
@@ -31,9 +38,9 @@ Also, the logic for where each parameter should be added to an API HTTP request
31
38
32
39
The first two steps are identical in 8.x. The final three steps replace the logic from 8.x that put all unrecognized parameters in the querystring.
33
40
34
-
**Impact**<br> Some adjustments to API calls may be necessary for code that used a `body` property 8.x, especially to appease the TypeScript type checker, but it should not have any impact on any code that was not using a `body` property.
41
+
**Impact**<br> Some parameters that were sent via querystring to Elasticsearch may be sent in the JSON request body, and vice versa.
35
42
36
-
**Action**<br> Check existing code for use of the `body` property, and move any properties that should be in the root object according to the API function's request type definition. If using TypeScript, the TypeScript type checker will surface most of these issues for you.
43
+
**Action**<br> If Elasticsearch sends back an error response due to a request not being valid, verify with the client's TypeScript type definitions, or via the docs, that the parameters your code passes are correct.
37
44
::::
38
45
39
46
::::{dropdown} Removal of the default 30-second timeout on all API calls
0 commit comments