调用 client.indices().getTemplate() 时意外的 JSON 事件 'VALUE_FALSE' 而不是 '[KEY_NAME, VALUE_STRING]'

Unexpected JSON event 'VALUE_FALSE' instead of '[KEY_NAME, VALUE_STRING]' when calling client.indices().getTemplate()

我正在编写一些代码来管理 ElasticSearch 模板。当 运行 下面的代码片段我得到

co.elastic.clients.json.UnexpectedJsonEventException: Unexpected JSON event 'VALUE_FALSE' instead of '[KEY_NAME, VALUE_STRING]'

(请参阅 https://discuss.elastic.co/t/java-unexpected-json-event-value-true-instead-of-key-name-value-string/295740 了解完整的调用堆栈 - 太长无法粘贴到此处)

代码

// simplified code for demo this issue, but does reproduce.
private static WhosebugIssue(ElasticsearchClient client) {
  GetIndexTemplateResponse r = client.indices().getIndexTemplate();
}

ES 信息:

{
  "name" : "1ec11a1cb3c9",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "7e0zLYxmQsST0EllSlc_KA",
  "version" : {
    "number" : "7.16.2",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "2b937c44140b6559905130a8650c64dbd0879cfb",
    "build_date" : "2021-12-18T19:42:46.604893745Z",
    "build_snapshot" : false,
    "lucene_version" : "8.10.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

pom.xml

中的 ES 依赖
        <dependency>
            <groupId>co.elastic.clients</groupId>
            <artifactId>elasticsearch-java</artifactId>
            <version>7.16.3</version>
        </dependency>

        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-api</artifactId>
            <version>2.0.1</version>
        </dependency>

请帮忙,谢谢!

这是一个由

跟踪的有效问题

https://github.com/elastic/elasticsearch-java/issues/139