You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently getParameterAnnotations(Method method) of the ReflectionUtils only checks the direct superclass for futher parameter annotations. If the method is overridden more than once, annotations wont be found if they are not declared in the declaring class of the method or its direct superclass.
Current Implementation:
public static Annotation[][] getParameterAnnotations(Method method) {
Annotation[][] methodAnnotations = method.getParameterAnnotations();
Method overriddenmethod = getOverriddenMethod(method);
if (overriddenmethod != null) {
Annotation[][] overriddenAnnotations = overriddenmethod
.getParameterAnnotations();
for (int i = 0; i < methodAnnotations.length; i++) {
List<Type> types = new ArrayList<>();
for (int j = 0; j < methodAnnotations[i].length; j++) {
types.add(methodAnnotations[i][j].annotationType());
}
for (int j = 0; j < overriddenAnnotations[i].length; j++) {
if (!types.contains(overriddenAnnotations[i][j]
.annotationType())) {
methodAnnotations[i] = ArrayUtils.add(
methodAnnotations[i],
overriddenAnnotations[i][j]);
}
}
}
}
return methodAnnotations;
}
I will link a pull request that can solve this issue.
The text was updated successfully, but these errors were encountered:
j-wrensch
added a commit
to j-wrensch/swagger-core
that referenced
this issue
Aug 19, 2021
Currently getParameterAnnotations(Method method) of the ReflectionUtils only checks the direct superclass for futher parameter annotations. If the method is overridden more than once, annotations wont be found if they are not declared in the declaring class of the method or its direct superclass.
Current Implementation:
I will link a pull request that can solve this issue.
The text was updated successfully, but these errors were encountered: