DynamicTemplates serializes MatchMappingType as a list #905
Labels
Area: Documentation
Improvements or additions to documentation
Category: Question
Not an issue but a question. May lead to enhancing docs
Java API client version
8.15.3
Java version
8
Elasticsearch Version
8.4.3
Problem description
Hey guys, I have some code that's using the
indices().putMapping()
API, and I think that I have found an issue when building thePutMappingRequest
object.I'm using the
withJson()
method, with this input:Notice how the
match_mapping_type
is a String primitive, not a list. Now, when the Builder constructs thePutMappingRequest
object, the request that it generates has this form:Notice how the
match_mapping_type
field was converted to a list. When using that in the request body to update the mapping, the ES responds with a 400 status:But if I use the
match_mapping_type
as a String (as it was originally in my JSON), it works. In short, the client is building this body:When it seems that it should be:
The text was updated successfully, but these errors were encountered: