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 type for order property in indices.putTemplate request #533

Closed
Tracked by #112131
cjcenizal opened this issue Aug 2, 2021 · 1 comment
Closed
Tracked by #112131

Comments

@cjcenizal
Copy link

🐛 Wrong type

The order property of this request body is expected to be on body.order instead of on the root.

Definition

A request like this completes successfully, despite TS complaints:

client.asCurrentUser.indices.putTemplate({
  name: 'test',
  order: 13,
});

It looks like IndicesPutTemplateRequest expects order to be a child of the body property: https://github.com/elastic/elasticsearch-specification/blob/main/specification/indices/put_template/IndicesPutTemplateRequest.ts#L49.

export interface Request extends RequestBase {
  path_parts?: {
    name: Name
  }
  query_parameters?: {
    create?: boolean
    flat_settings?: boolean
    include_type_name?: boolean
    master_timeout?: Time
    timeout?: Time
  }
+  order?: integer
  body?: {
    aliases?: Dictionary<IndexName, Alias>
    index_patterns?: string | string[]
    mappings?: TypeMapping
-    order?: integer
    settings?: Dictionary<string, UserDefinedValue>
    version?: VersionNumber
  }
}
@delvedor
Copy link
Member

delvedor commented Aug 3, 2021

According to the doc it can go either in the body or in the querystring, I'll update our definition to accept it in the quertystring as well :)

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