private static Optional<String> getNameFromSubTypeAnnotation(Class<?> erasedTargetType, JsonSubTypes subTypesAnnotation) {
        if (subTypesAnnotation == null) {
            return Optional.empty();
        }
        return Stream.of(subTypesAnnotation.value())
                .filter(subTypeAnnotation -> erasedTargetType.equals(subTypeAnnotation.value()))
                .findFirst()
                .map(JsonSubTypes.Type::name)
                .filter(name -> !name.isEmpty());
    }
In case of a {@code JsonTypeInfo.Id.NAME}, try to look up the reference via {@link JsonSubTypes} annotation.

@param erasedTargetType class to look-up the "name" for
@param subTypesAnnotation {@link JsonSubTypes} annotation instance of consider
@return successfully looked-up "name" (otherwise an empty {@code Optional})
jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonSubTypesResolver.java