Elasticsearch-js: Camel Case issue with Elastic SDK in Typescript

Created on 11 Apr 2020  路  2Comments  路  Source: elastic/elasticsearch-js

Hi. I am using the latest verison of elasicsearch-js SDK and I noticed the docs in client.indices.create that they said we can use both underscore as well as camel casing (https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)

Screenshot from 2020-04-11 18-29-43

That is, wait_for_active_shards or waitForActiveShards, include_type_name or includeTypeName

But, when I am using camelcase, I am getting error in typescript since they are not defined in the interface file (Screenshot below).

Screenshot from 2020-04-11 18-32-32

Thought I would let you guys know. Thanks.

question

All 2 comments

Hello! Thank you for reporting, but this is a design decision, as you can鈥檛 have both camelCase and snake_case keys while you need to support required parameter as well.

There is a note about this in the typescript documentation :)

Oops. Missed to see that. Thanks for the clarification.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peshrawahmed picture peshrawahmed  路  3Comments

offlineError picture offlineError  路  4Comments

mojzu picture mojzu  路  4Comments

drakejin picture drakejin  路  4Comments

lizpark picture lizpark  路  3Comments