@Override
    public <A extends Annotation> A getAnnotation(Class<A> annotationClass, Predicate<Annotation> considerOtherAnnotation) {
        A annotation = super.getAnnotation(annotationClass, considerOtherAnnotation);
        if (annotation == null) {
            List<Annotation> annotationList = Arrays.asList(this.getRawMember().getAnnotatedReturnType().getAnnotations());
            annotation = this.getContext().getAnnotationFromList(annotationClass, annotationList, considerOtherAnnotation);
        }
        return annotation;
    }
Return the annotation of the given type on the method or its return type, if such an annotation is present.

@param <A> type of annotation to look-up
@param annotationClass annotation class to look up instance on member for
@return annotation instance (or {@code null} if no annotation of the given type is present
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/MethodScope.java