-
Notifications
You must be signed in to change notification settings - Fork 609
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
Add response types #75
Comments
So, the fundamental principle of the "low-level" client is that it doesn't "touch" the body, either for request in response; this is for multiple reasons:
That's a pretty brave statement :) In fact, Elasticsearch has quite a lot of completely different response structures, not only for different APIs, but also within a single API, like Search. As of now, there is no formal specification of the request and response body structures — as we have for the API "surface" —, making it impractical (or impossible) to provide a reliable and maintainable implementation of the structure. (The maintainability of the With that in mind, you absolutely don't have to "define response type structs all over the place". First of all, the package implements the Second, when it comes to the request body, the library provides a helper, Third, in many cases, it's impractical to define the full representation of the Elasticsearch response, because you're interested only in specific parts. For this, the Have you seen the examples in |
Hello, any news here? |
Hi @jordansissel, closing for now, please re-open if you want to discuss the topic more? |
elasticsearch.Client.Get() returns
*Response, error
Most responses in Elasticsearch will have at least a top-level predictable response structure. It'd be nice, for example, if
Get()
returned something like aGetResponse
.The workaround is roughly the following for every kind of response:
Thoughts? Maybe I'm missing something in the docs, but it'd be very nice not to have to define response type structs all over the place.
The text was updated successfully, but these errors were encountered: