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

mtermvectors with artificial documents fails when deserializing response #838

Closed
spacelore opened this issue Jun 26, 2024 · 1 comment · Fixed by #847
Closed

mtermvectors with artificial documents fails when deserializing response #838

spacelore opened this issue Jun 26, 2024 · 1 comment · Fixed by #847
Labels
Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working

Comments

@spacelore
Copy link

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;

}

@l-trotta
Copy link
Contributor

see #839

@l-trotta l-trotta added Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code Category: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants