Open ronag opened 1 year ago
Thanks for the report @ronag! In many cases we defer validation to Elasticsearch itself for simplicity's sake, but ideally the client should validate required parameters like body
before sending the request, like you're suggesting. I'll try to take a look at this soon.
@ronag hello
You wrote:
the client should validate and throw an error
May I ask what additional value this creates for library users?
@bijela-gora The value of client-side validation is that it makes validation much faster by having it happen in-process rather than deferring to a remote server. It also prevents unnecessary network traffic and load on Elasticsearch, and allows for more developer-friendly feedback.
Hi! Thank you for your response.
In my previous post, I referred to specific numbers differences, specifically related to feedback speed. In the context of feedback speed there are three things we can use to improve:
Considering these factors, I believe client-side runtime validation may not offer significant value to end users. Focusing on type system improvements might be more beneficial.
Thanks for reading this.
HI @JoshMock - Can I work on this issue ? this would be my first contribution to this project ? Thank you!
While calling:
We get the following server error. Looks like an esc client bug? Even
Getting this server response should not even be possible since the client should validate and throw an error even if we the user are doing something wrong...