public Map<String, FieldMapping> fieldTypes(final String index) {
        final JsonNode result = client.executeRequest(request(index), "Unable to retrieve field types of index " + index);
        final JsonNode fields = result.path(index).path("mappings").path("properties");
        //noinspection UnstableApiUsage
        return Streams.stream(fields.fields())
                .collect(Collectors.toMap(Map.Entry::getKey, entry -> {
                    final JsonNode entryValue = entry.getValue();
                    String type = entryValue.path("type").asText();
                    if ("alias".equals(type)) {
                        String aliasPath = entryValue.path("path").asText();
                        type = fields.path(aliasPath).path("type").asText();
                    }
                    return FieldMapping.create(
                            type,
                            entryValue.path("fielddata").asBoolean()
                    );
                }));
    }
@Test
    void testReturnsEmptyMapOnNoMappings() throws Exception {
        String mappingResponse = """
                {
                  "graylog_13": {
                    "mappings": {
                      "properties": {
                      }
                    }
                  }
                }
                """;
        doReturn(objectMapper.readTree(mappingResponse))
                .when(client)
                .executeRequest(eq(new Request("GET", "/graylog_13/_mapping")), anyString());

        final Map<String, FieldMappingApi.FieldMapping> result = toTest.fieldTypes("graylog_13");
        assertEquals(Map.of(), result);
    }