### Description

The health API response can become a few MBs (2-3MB if 50K indices are affected).

In less extreme situations the response can be in the 10s/100s of KB. 

It might be worthwhile looking into chunking its response (this might provide clients with a better experience too)
server/src/test/java/org/elasticsearch/health/HealthIndicatorResultTests.java
"affected_resources",
                    XContentHelper.convertToMap(BytesReference.bytes(diagnosisXContent), false, builder.contentType())
                        .v2()
                        .get("affected_resources")
                );
            }
            expectedDiagnosis.add(expectedDiagnosis1);
        }
        {
            Map<String, Object> expectedDiagnosis2 = new HashMap<>();
            expectedDiagnosis2.put("id", HEALTH_API_ID_PREFIX + name + ":diagnosis:" + diagnosis2.definition().id());
            expectedDiagnosis2.put("cause", diagnosis2.definition().cause());
            expectedDiagnosis2.put("action", diagnosis2.definition().action());
            expectedDiagnosis2.put("help_url", diagnosis2.definition().helpURL());
            if (diagnosis2.affectedResources() != null) {
                XContentBuilder diagnosisXContent = XContentFactory.jsonBuilder().prettyPrint();
                diagnosis2.toXContent(diagnosisXContent, ToXContent.EMPTY_PARAMS);
                expectedDiagnosis2.put(
                    "affected_resources",
                    XContentHelper.convertToMap(BytesReference.bytes(diagnosisXContent), false, builder.contentType())
                        .v2()
                        .get("affected_resources")
                );
            }
            expectedDiagnosis.add(expectedDiagnosis2);
        }
        assertEquals(expectedDiagnosis, xContentMap.get("diagnosis"));
    }
}