private static List<String> getStructFieldAttributes(Collection<? extends ImmutableSDField> structFields,
                                                         boolean returnAllTypes) {
        var result = new ArrayList<String>();
        for (var structField : structFields) {
            for (var attr : structField.getAttributes().values()) {
                if (returnAllTypes || !ComplexAttributeFieldUtils.isPrimitiveType(attr)) {
                    result.add(attr.getName());
                }
            }
            if (structField.usesStructOrMap() && structField.wasConfiguredToDoAttributing()) {
                result.add(structField.getName());
            }
            // If we encounter struct field attributes underneath this level, those are not supported and should be returned.
            result.addAll(getStructFieldAttributes(structField.getStructFields(), true));
        }
        return result;
    }
Validates that complex fields (of type struct or map) that have struct field attributes are supported.

Only applies for indexed search clusters.

@author geirst
config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldAttributesValidator.java