Skip to content
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

Error deserializing co.elastic.clients.elasticsearch._types.analysis.Normalizer: Property 'type' not found #696

Closed
czyzowskibartosz opened this issue Oct 20, 2023 · 1 comment · Fixed by #815
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@czyzowskibartosz
Copy link

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 (#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");
@l-trotta
Copy link
Contributor

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.

@l-trotta l-trotta added the Area: Specification Related to the API spec used to generate client code label Apr 24, 2024
@l-trotta l-trotta added Area: Specification Related to the API spec used to generate client code and removed Area: Specification Related to the API spec used to generate client code labels May 8, 2024
This was referenced May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
2 participants