void fillAnnotationStruct(ParsedAnnotation annotation) {
        var withStruct = annotation.getStruct();
        if (withStruct.isPresent()) {
            var doc = annotation.getOwnerDoc();
            var toFill = findStructFromParsed(withStruct.get());
            for (ParsedField field : withStruct.get().getFields()) {
                var t = resolveFromContext(field.getType(), doc);
                var f = field.hasIdOverride()
                    ? new com.yahoo.document.Field(field.name(), field.idOverride(), t)
                    : new com.yahoo.document.Field(field.name(), t);
                toFill.addField(f);
            }
            for (var parent : annotation.getResolvedInherits()) {
                parent.getStruct().ifPresent
                    (ps -> toFill.inherit(findStructFromParsed(ps)));
            }
            var at = findAnnotationFromParsed(annotation);
            at.setDataType(toFill);
        }
    }
Helper class for converting ParsedType instances to DataType

@author arnej27959
config-model/src/main/java/com/yahoo/schema/parser/ConvertParsedTypes.java