-
Notifications
You must be signed in to change notification settings - Fork 183
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
618 withjson support method for put index template request #657
base: main
Are you sure you want to change the base?
618 withjson support method for put index template request #657
Conversation
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of requests that support JSON bodies. I think we need to introduce a class or train that supports withJson
at a lower level than PutIndexTemplateRequest
and then include that in it. WDYT?
Yes, that would be great. I will look into that. |
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
…exTemplateRequest Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
@pranishd1 Can you fix merge conflicts please? Also, you might have to run |
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
java-client/src/main/java/org/opensearch/client/util/WithJsonBuilderBase.java
Outdated
Show resolved
Hide resolved
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
Signed-off-by: pranishd1 <8871437+pranishd1@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also mention in the USER_GUIDE that how to use withJson
?
This is a lot better! Can we apply this to at least some minimum number of requests, not just put index template? I'd also love a guide (maybe copy from opensearch-project/opensearch-py#542?) and a working sample as part of this PR, please? |
sure, I will add a section about how to use this to the user guide. |
Yeah, sure I will add this to a few other requests. Thanks for the feedback. |
@pranishd1 Want to finish this? |
@dblock , sorry about the delay. I am in the process of implementing the interface in create, search and delete requests. While doing so, I am stuck at object deserialization process. This method does not cover all the objects. |
Thanks for this guys, much needed, do you need any help with this? public static final JsonpDeserializer<SearchRequest> _DESERIALIZER = ObjectBuilderDeserializer.lazy(
Builder::new,
SearchRequest::setupSearchRequestDeserializer
); Although some suggestions -
default<T> B withJson(Reader reader) {
........
|
@Jai2305 looks like the PR hasn't been touched in a long time, so yes, would love it if you could pick it up and finish it! Note that we added support for a generic interface since which takes/returns raw JSON, so some parts of that may be reusable. |
Description
Added "withJson" support for PutIndexTemplateRequest
Issues Resolved
Closes [#618]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.