-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ES 9.0] Remove body workaround (@elastic/response-ops)
#217216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ES 9.0] Remove body workaround (@elastic/response-ops)
#217216
Conversation
@elastic/response-ops@elastic/response-ops)
…ody-workaround/elastic/response-ops
|
Pinging @elastic/response-ops (Team:ResponseOps) |
| // @ts-expect-error According to the docs, sort should be a comma-separated list of fields and goes in the querystring. | ||
| // However, this one is using a "body" format? | ||
| body: { sort }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know there are some APIs that are permissive about putting some query parameters in the body instead, but the spec may be more strict, intentionally or not. @pquentin I know this has come up a couple times recently in the spec; do we have a preference on how the spec handles things that can go in query or body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec should reflect reality: if both are accepted it means that Elasticsearch has specific code for both, and we should encode it in the spec.
Then it's up to the clients to choose which one to use, usually the body form.
Also, note that in 9.x the documentation for endpoints is generated from the spec, which will avoid those discrepancies.
| query, | ||
| // @ts-expect-error According to the docs, sort should be a comma-separated list of fields and goes in the querystring. | ||
| // However, this one is using a "body" format? | ||
| body: { sort }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this saying we're formatting the sort wrong or this function is expecting the sort in the body field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ymao1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Verified alerts and event log indices are installed and reinstalled successfully for both serverless and server-ful across restarts. Verified task manager update by queries continue to claim tasks as expected.
💚 Build Succeeded
Metrics [docs]
History
cc @afharo |
Summary
Follow up to #213375: The latest version of the ES client fixed the issue elastic/elasticsearch-js#2584.
We should be able to remove all usages of
// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584.Checklist