mtermvectors with artificial documents fails when deserializing response
spacelore opened this issue · 1 comments
spacelore commented
Java API client version
8.14.1
Java version
21
Elasticsearch Version
8.14.1
Problem description
This is related to #716 as although no error occurs when submitting the request when using artificial documents now, there is an error when retrieving the response
POST /_mtermvectors
{
"docs": [
{
"_index": "myIndex",
"doc": {
"foo" : "bar"
}
}
]
}
Caused by: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'MultiTermVectorsResult.id'
at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76) ~[elasticsearch-java-8.14.1.jar:?]
at co.elastic.clients.elasticsearch.core.mtermvectors.MultiTermVectorsResult.<init>(MultiTermVectorsResult.java:90) ~[elasticsearch-java-8.14.1.jar:?]
at co.elastic.clients.elasticsearch.core.mtermvectors.MultiTermVectorsResult.<init>(MultiTermVectorsResult.java:67) ~[elasticsearch-java-8.14.1.jar:?]
The code still has id as required although it is not returned in the response when using artificial documents
private MultiTermVectorsResult(Builder builder) {
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
this.version = builder.version;
this.took = builder.took;
this.found = builder.found;
this.termVectors = ApiTypeHelper.unmodifiable(builder.termVectors);
this.error = builder.error;
}