private ResolvedType resolveSubtype(ResolvedType declaredType, JsonSubTypes.Type annotatedSubtype, TypeContext context) {
        try {
            return context.resolveSubtype(declaredType, annotatedSubtype.value());
        } catch (IllegalArgumentException ex) {
            return context.resolve(annotatedSubtype.value());
        }
    }
Safe way of resolving an erased subtype from its supertype. If the subtype introduces generic parameters not present on the supertype, the
subtype will be resolved without any type parameters - for simplicity's sake not even the ones declared alongside the supertype then.

@param declaredType supertype encountered while generating a schema
@param annotatedSubtype single subtype declared via {@link JsonSubTypes} on the super class
@param context type context for proper type resolution
@return resolved annotated subtype
jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonSubTypesResolver.java