Skip to content
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

Incorrect TS types for GET _snapshot/<repo>/<snapshot> response #250

Closed
jloleysens opened this issue Mar 26, 2021 · 1 comment
Closed

Incorrect TS types for GET _snapshot/<repo>/<snapshot> response #250

jloleysens opened this issue Mar 26, 2021 · 1 comment

Comments

@jloleysens
Copy link

🐛 Bug Report

The TS type for calling client.snapshot.get is associated with the following type:

https://github.com/elastic/elasticsearch-js/blob/7a3cfe7e23b7a81c563f4deaa2990fed4c321ee9/api/types.d.ts#L6069

When looking at the actual response from the cluster it is of the form:

{
  "responses": [
    {
      "repository": "my-repo",
      "snapshots": [ /* list of snapshots... */ ]
    }
}

The TS type is missing the responses array of objects in which snapshots is nested.

Actual request:

          const response = await client.snapshot.get({
            repository,
            snapshot: '_all',
            ignore_unavailable: true, // Allow request to succeed even if some snapshots are unavailable.
          });

Expected behavior

The TS types should match the shape of the response from the cluster.

Your Environment

  • @elastic/elasticsearch npm:@elastic/elasticsearch-canary@^8.0.0-canary.4
@delvedor delvedor transferred this issue from elastic/elasticsearch-js Mar 29, 2021
@delvedor
Copy link
Member

delvedor commented Apr 7, 2021

Closed in #274.

@delvedor delvedor closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants