private Optional<ResolvedType> getIdentityReferenceType(JsonIdentityReference referenceAnnotation, ResolvedType javaType,
            TypeContext typeContext) {
        if (referenceAnnotation == null || !referenceAnnotation.alwaysAsId()) {
            // no replacement if no @JsonIdentityReference annotation is present or it has "alwaysAsId=false"
            return Optional.empty();
        }
        // additionally, the type itself must have a @JsonIdentityInfo annotation
        ResolvedType typeWithIdentityInfoAnnotation = typeContext.getTypeWithAnnotation(javaType, JsonIdentityInfo.class,
                JacksonModule.NESTED_ANNOTATION_CHECK);
        if (typeWithIdentityInfoAnnotation == null) {
            // otherwise, the @JsonIdentityReference annotation is simply ignored
            return Optional.empty();
        }
        JsonIdentityInfo identityInfoAnnotation = typeContext.getAnnotationFromList(JsonIdentityInfo.class,
                Arrays.asList(typeWithIdentityInfoAnnotation.getErasedType().getAnnotations()), JacksonModule.NESTED_ANNOTATION_CHECK);
        // @JsonIdentityInfo annotation declares generator with specific identity type
        ResolvedType identityTypeFromGenerator = typeContext.getTypeParameterFor(typeContext.resolve(identityInfoAnnotation.generator()),
                ObjectIdGenerator.class, 0);
        if (identityTypeFromGenerator == null || identityTypeFromGenerator.getErasedType() == Object.class) {
            // the identity may be derived from a property
            String idPropertyName = identityInfoAnnotation.property();
            ResolvedField[] eligibleFields = typeContext.resolveWithMembers(typeWithIdentityInfoAnnotation).getMemberFields();
            Optional<ResolvedType> identityTypeFromProperty = Stream.of(eligibleFields)
                    .filter(field -> field.getName().equals(idPropertyName))
                    .map(ResolvedMember::getType)
                    .findFirst();
            if (identityTypeFromProperty.isPresent()) {
                return identityTypeFromProperty;
            }
        }
        return Optional.ofNullable(identityTypeFromGenerator);
    }
If applicable, determine the type of the identity reference that should replace the given actual type, if the
{@code @JsonIdentityReference(alwaysAsId = true)} annotation is present as well as a corresponding {@code @JsonIdentityInfo} annotation on the
type itself.

@param referenceAnnotation the applicable {@code @JsonidentityReference} annotation in the given context (may be {@code null})
@param javaType reference type that may be replaced by a reference to its identity property
@param typeContext type context providing convenience methods, e.g., for the annotation or member look-up
@return designated type of the applicable identity reference (may be empty)
jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonIdentityReferenceDefinitionProvider.java