private void resolveInheritedReferencesRecursive(SDDocumentType documentType,
                                                     Collection<SDDocumentType> inheritedTypes) {
        for (var inheritedType : inheritedTypes) {
            documentType.getDocumentReferences().get().mergeFrom(inheritedType.getDocumentReferences().get());
        }
        for (var inheritedType : inheritedTypes) {
            resolveInheritedReferencesRecursive(documentType, inheritedType.getInheritedTypes());
        }
    }
Resolves all document references in the search definitions

Iterates through all document fields having a {@link NewDocumentReferenceDataType} and uses {@link NewDocumentReferenceDataType#getTargetTypeName()}
to determine the referenced document. This information is aggregated into a {@link DocumentReferences} object.

@author bjorncs
config-model/src/main/java/com/yahoo/schema/DocumentReferenceResolver.java