-
Notifications
You must be signed in to change notification settings - Fork 190
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
Creating API objects from JSON data #302
Comments
@owaiskazi19 this issue is a "general" request for supporting creation of all API objects from JSON. Specifically, on our project, we are mostly interested in being able to create queries from JSON, something like below:
|
This sounds like a good idea. Feel free to create a PR. |
The functionality proposed here would be quite helpful. As @assafcoh pointed out, it would be a "general" solution. It would also apply to more special feature requests such as asking for custom JSON input for mapping information (#362) or for documents (#257). There is something like that in the Elastic Java client. For example the builders of That allows for code such as the following:
As that client is licensed under the Apache 2.0 license, it should be possible to reuse that (or a similar) approach also for the OpenSearch Java client. |
Please feel free to contribute! When making PRs we trust you to make sure you're not copying any non-APLv2 code. |
Is your feature request related to a problem?
It is currently not possible to create API objects from JSON data.
What solution would you like?
For example we would like to do something like code below:
What alternatives have you considered?
This withJson() method is currently supported on all API objects of the elasticsearch java client, and after moving to opensearch we feel this enhancement is greatly needed in opensearch java client too.
The text was updated successfully, but these errors were encountered: