Using:
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>8.13.4</version>
</dependency>
When executing something like:
CreateIndexRequest createIndexRequest = CreateIndexRequest.of(b -> b
.index(indexName)
.withJson(input)
);
CreateIndexResponse response = elasticsearchAsyncClient.indices().create(createIndexRequest).get();
Where input contains an elasticsearch schema that utilizes dynamic templates with path_match where its value is an array like:
{
"settings": {
// Some settings
},
"mappings": {
"dynamic": "strict",
"dynamic_templates": [
{
"some_template": {
"path_match": [
"some_field",
"some_other_field"
],
"mapping": {
}
}
}
],
"properties": {
// Some properties
}
}
}
Is failing with error:
co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch._types.mapping.DynamicTemplate: co.elastic.clients.json.UnexpectedJsonEventException: Unexpected JSON event 'START_ARRAY' instead of '[KEY_NAME, VALUE_STRING, VALUE_NUMBER, VALUE_TRUE, VALUE_FALSE]'