Skip to content

PutTemplateRequest - Unknown field 'composed_of' #814

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

Closed
mdgilene opened this issue May 23, 2024 · 1 comment
Closed

PutTemplateRequest - Unknown field 'composed_of' #814

mdgilene opened this issue May 23, 2024 · 1 comment

Comments

@mdgilene
Copy link

Java API client version

8.7.1

Java version

17

Elasticsearch Version

7.17.5

Problem description

Attempting to create a index template following the updated documentation recommending the usage of composable index templates with component templates. (https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html)

Caused by: co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch.indices.PutTemplateRequest: Unknown field 'composed_of'
client.indices()
    .putTemplate(
        r -> r.withJson(new StringReader("""
            {
                "composed_of": "my_component_template"
            }
            """))
            .name("my_index_template")
            .indexPatterns("prefix-*")

Note how I even had to use withJson to even set the composed_of property because there is no method for it.

@l-trotta
Copy link
Contributor

Hello! Yes the api specification used to produce the java client code didn't match the server code perfectly for template requests up until recently when it was fixed with this PR; updating the client to the latest version should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants