Error: using Java API calling ElasticsearchClient method healthReport()

I'm using co.elastic.clients:elasticsearch-java:8.13.4 and get a deserilizing error calling the healthReport() method:

HealthReportResponse health = myEsClient.healthReport();

Error:

co.elastic.clients.json.JsonpMappingException: 
Error deserializing co.elastic.clients.elasticsearch.core.health_report.SlmIndicator:
 co.elastic.clients.util.MissingRequiredPropertyException:
 Missing required property 'SlmIndicatorDetails.unhealthyPolicies' (JSON path: indicators.slm.details) (line no=1, column no=1294, offset=-1)

Debugging ElasticsearchTransportBase shows the response 'resp':

requestLine: GET /_health_report HTTP/1.1

is OK (HTTP/1.1 200 OK) I can also call this over REST and get some JSON, however your deceriliser breaks...

The value of content at line ElasticsearchTransportBase:396

{"status":"green","cluster_name":"docker-cluster","indicators":{"master_is_stable":{"status":"green","symptom":"The cluster has a stable master node","details":{"current_master":{"node_id":"uPJ5mfP4RP-UMnMU6C5ugQ","name":"es"},"recent_masters":[{"node_id":"uPJ5mfP4RP-UMnMU6C5ugQ","name":"es"}]}},"repository_integrity":{"status":"green","symptom":"No snapshot repositories configured."},"shards_availability":{"status":"green","symptom":"This cluster has all shards available.","details":{"creating_primaries":0,"unassigned_replicas":0,"restarting_primaries":0,"restarting_replicas":0,"initializing_primaries":0,"started_replicas":0,"initializing_replicas":0,"unassigned_primaries":0,"started_primaries":0}},"disk":{"status":"green","symptom":"The cluster has enough available disk space.","details":{"indices_with_readonly_block":0,"nodes_with_enough_disk_space":1,"nodes_with_unknown_disk_status":0,"nodes_over_high_watermark":0,"nodes_over_flood_stage_watermark":0}},"shards_capacity":{"status":"green","symptom":"The cluster has enough room to add new shards.","details":{"data":{"max_shards_in_cluster":1000},"frozen":{"max_shards_in_cluster":3000}}},"slm":{"status":"green","symptom":"No Snapshot Lifecycle Management policies configured","details":{"slm_status":"RUNNING","policies":0}},"ilm":{"status":"green","symptom":"Index Lifecycle Management is running","details":{"policies":20,"stagnating_indices":0,"ilm_status":"RUNNING"}}}}

Hello, thanks for reporting this! It's a problem with the API specification used to produce the client code, the property unhealthy_policies is set as "required", but it shouldn't be. If you want you can create a new issue in the java client repo.

Raised issue Deserilizing error calling the healthReport() method. · Issue #834 · elastic/elasticsearch-java · GitHub