Error deserializing co.elastic.clients.elasticsearch._types.analysis.Normalizer: Property 'type' not found
Java API client version
8.10.4
Java version
17
Elasticsearch Version
8.10.2
Problem description
We're migrating to new client. I came across a potential bug while using:
GetIndicesSettingsResponse settings = esClient().indices().getSettings(builder -> builder.index("abc"));
which fails with: Error deserializing co.elastic.clients.elasticsearch._types.analysis.Normalizer: Property 'type' not found
GET abc/_settings returns successfully, and there's one normalizer without type property set:
"normalizer": {
"case_insensitive": {
"filter": "lowercase"
}
}
I assume that this is because in co.elastic.clients.elasticsearch._types.analysis.Normalizer#setupNormalizerDeserializer type is set to null.
I found similar issue related to Analyzer (https://github.com/elastic/elasticsearch-java/issues/392 where co.elastic.clients.elasticsearch._types.analysis.Analyzer#setupAnalyzerDeserialize type is set to custom.
Temporary solution is to adjust the type manually but it's not ideal. Please confirm if it's a bug and when it'll be resolved.
final ObjectDeserializer unwrapped = (ObjectDeserializer) DelegatingDeserializer.unwrap(Normalizer._DESERIALIZER);
unwrapped.setTypeProperty("type", "custom");
Hello, thanks for reporting this! Yes type in both normalizers should be optional, it's an issue with the API specification used to produce the Java code. Once it's fixed the Java client code will be updated to solve this.