What is the bug?
I am using opensearch-java client 2.12.0
Describe the issue:
I have a specific requirement where I will be using aggregations on a index, but I want to use SQL plugin for that. Since the response for the aggregations from OpenSearchClient is very complicated.
I am trying to deserialize the response but getting below error:
Exception in thread "main" jakarta.json.stream.JsonParsingException: Property name 'year' is not in the 'type#name' format. Make sure the request has 'typed_keys' set.
final String body = response.getBody().map(org.opensearch.client.opensearch.generic.Body::bodyAsString).orElse("");
What is the bug? I am using opensearch-java client 2.12.0
Describe the issue: I have a specific requirement where I will be using aggregations on a index, but I want to use SQL plugin for that. Since the response for the aggregations from OpenSearchClient is very complicated.
I am trying to deserialize the response but getting below error:
Exception in thread "main" jakarta.json.stream.JsonParsingException: Property name 'year' is not in the 'type#name' format. Make sure the request has 'typed_keys' set.
I get the below response as part of Response body
Below is the code I am trying to deserialize the response
Below is my code for the same
Do you have any additional context? (https://forum.opensearch.org/t/generic-client-with-custom-deserializer-fails-to-deserialize-aggregations/20739)