private static void traverseChildren(ImmutableMap.Builder<String, String> docStrings, String prefix,
                                         String delimiter, Object node) {
        if (node instanceof Map) {
            @SuppressWarnings("unchecked")
            final Map<String, Object> map = (Map<String, Object>) node;
            final String name = (String) map.get("name");
            final String doc = (String) map.get("doc");
            final String childPrefix;
            if (name != null) {
                childPrefix = prefix + delimiter + name;
                if (doc != null) {
                    docStrings.put(childPrefix, doc.trim());
                }
            } else {
                childPrefix = prefix;
            }
            map.forEach((key, value) -> traverseChildren(docStrings, childPrefix, DELIM, value));
        } else if (node instanceof Iterable) {
            @SuppressWarnings("unchecked")
            final Iterable<Object> children = (Iterable<Object>) node;
            children.forEach(child -> traverseChildren(docStrings, prefix, DELIM, child));
        }
    }
{@link ThriftDocStringExtractor} is a DocString extractor for Thrift IDL JSON.

<p>To include docstrings in {@link DocService} pages, use the Thrift compiler version 0.10.0 or above
(0.9.3 will not work) and compile your thrift files with 'json' code generation and include the resulting
json files in the classpath location {@code META-INF/armeria/thrift}. The classpath location can be changed
by setting the {@code com.linecorp.armeria.thrift.jsonDir} system property.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/server/thrift/ThriftDocStringExtractor.java