elastic/elasticsearch-java

GetIndexTemplate call fails with MissingRequiredPropertyException: Missing required property 'IndexTemplate.composedOf'

sothawo opened this issue · 10 comments

Java API client version

8.12.0

Java version

17.0.10

Elasticsearch Version

8.12.0

Problem description

Since version 8.12.0 the composedOf property of the IndexTemplate is not nullable anymore (https://github.com/elastic/elasticsearch-specification/blob/main/specification/indices/_types/IndexTemplate.ts#L40)

It is not possible now to read an index template that is not composed of other components. But this is still a valid case (see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html#put-index-template-api-request-body, composedOf is optional).

Using the try ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true)) workaround does not help, because the json deserializer tries to deserialize null into a list when adding this.

8.11.4 did not have this problem.

Not sure wether this is a problem of the client, or the serverside. Posted this issue on the main project: elastic/elasticsearch#104627

The line in the specification did not change for two years. And the client made no change between 8.11.4 and 8.12.0
https://github.com/elastic/elasticsearch-java/blob/v8.12.0/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java#L58
https://github.com/elastic/elasticsearch-java/blob/v8.11.4/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java#L58

The quoted API is for PUT-Requests and describes an optional parameter, that you can put in your body.

The quoted API is for PUT-Requests and describes an optional parameter, that you can put in your body.

Yes, I saw that, but there is no documentation what get returns, so I linked that. Supposing that I can get back what I put in. I noticed because the build of spring-data-elasticsearch failed after the upgrade. Thanks for adding this bug to the main project.

Does it still happens in 8.12.1 or do you find any workaround?

The PR in the Elasticsearch project that restores the previous behaviour (elastic/elasticsearch#105315) is tagged with v8.13. It seems we have to wait some time then.

image
wow, now planned for 8.14?

I downgraded my system to 8.11.4 due to this bug... :(

yeah, in 2 days there should be the milestone-1 release of Spring Data Elasticsearch 2024.0.0-M1 and I need to stay on 8.11 as well. Only waiting for the Spring Boot team to ask me to bump up to 8.12 before boot 3.3.0-M2 is released and then telling them "no".

I have the same problem. Is very basic functionality, why does this have to take so long? Anyone aware of a workaround except for staying on 8.11.4?

I saw that 8.12.2 was released yesterday, so this weekend I will check if Spring Data Elasticsearch can update.

Otherwise you probably can update your app to use 8.12, just don't use a server running 8.12.

Seems to be fixed in 8.12.2, so this issue can be closed