You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This check is not needed and the whole purpose for us is to create the template object using builder. Infact see the sample code where "template" is not explicitly created part of the builder.
Currently due to this check, a requireNonNull error is thrown and we cannot use the PutComponentTemplateRequest object in building component templates via RestClient java api.
Error below Exception in thread "main" org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'PutComponentTemplateRequest.template' at org.opensearch.client.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:90) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest.<init>(PutComponentTemplateRequest.java:107) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest.<init>(PutComponentTemplateRequest.java:67) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest$Builder.build(PutComponentTemplateRequest.java:464) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest$Builder.build(PutComponentTemplateRequest.java:262) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest.of(PutComponentTemplateRequest.java:113) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:131) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:89) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139) at App.main(App.groovy:82)
The text was updated successfully, but these errors were encountered:
Hi Team,
Please find the below code -
https://github.com/opensearch-project/opensearch-java/blame/bb0fa12098ed3ef8b785a4560d6d962b2726a0d2/java-client/src/main/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java#L107
this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template");
This check is not needed and the whole purpose for us is to create the template object using builder. Infact see the sample code where "template" is not explicitly created part of the builder.
Currently due to this check, a requireNonNull error is thrown and we cannot use the
PutComponentTemplateRequest
object in building component templates via RestClient java api.Error below
Exception in thread "main" org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'PutComponentTemplateRequest.template' at org.opensearch.client.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:90) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest.<init>(PutComponentTemplateRequest.java:107) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest.<init>(PutComponentTemplateRequest.java:67) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest$Builder.build(PutComponentTemplateRequest.java:464) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest$Builder.build(PutComponentTemplateRequest.java:262) at org.opensearch.client.opensearch.cluster.PutComponentTemplateRequest.of(PutComponentTemplateRequest.java:113) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:131) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:89) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139) at App.main(App.groovy:82)
The text was updated successfully, but these errors were encountered: