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

[ENHANCEMENT] strong typed Response. #140

Closed
GopherJ opened this issue Sep 15, 2020 · 5 comments
Closed

[ENHANCEMENT] strong typed Response. #140

GopherJ opened this issue Sep 15, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@GopherJ
Copy link

GopherJ commented Sep 15, 2020

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when there elasticsearch-rs is not strongly typed, I cannot deserialize my response to some kind of type.

elastic-rs has elastic-types if I rememembered correctly, cannot we port them here? Not strongly typed makes elasticsearch-rs not too many advantages over reqwest. It becomes only a wrapper of reqwest.....

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@GopherJ GopherJ added the enhancement New feature or request label Sep 15, 2020
@GopherJ
Copy link
Author

GopherJ commented Sep 15, 2020

@GopherJ
Copy link
Author

GopherJ commented Sep 15, 2020

https://github.com/elastic-rs/elastic/blob/312eeb22b6ad60072a80680fbec27f466cdcb9b3/src/elastic/src/client/responses/search.rs#L78-L91

is more urgent I think, can we have it in elasticsearch-rs?

I need basically https://github.com/elastic-rs/elastic/blob/312eeb22b6ad60072a80680fbec27f466cdcb9b3/src/elastic/src/client/responses/bulk.rs#L149-L158, now I'll copy elastic-rs's code, but can we have them recently? Because I'll have other softwares to develop using elasticsearch-rs.

It's pretty important to have strongly typed response

@GopherJ
Copy link
Author

GopherJ commented Sep 15, 2020

A thing like https://docs.rs/elasticsearch/7.9.0-alpha.1/elasticsearch/http/response/struct.Response.html isn't really useful, we don't have other info except top-level error code, if it's bulk request the error code isn't that useful.

Somehow users will then need to define their own types, which decreases elasticsearch-rs's advantags over a pure reqwest.

I'm wondering if this means I should combine elasticsearch-rs and elastic-rs's types together?

@GopherJ
Copy link
Author

GopherJ commented Sep 15, 2020

@russcam Any idea on this?

@russcam
Copy link
Contributor

russcam commented Sep 15, 2020

@GopherJ there is already an issue open to discuss request and response types: #75. Please have a read of the other issue and discuss there. Thanks!.

@russcam russcam closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants