Skip to content

Commit

Permalink
fix loop when reponse inherits generic class springdoc#2271
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospds committed Jun 26, 2023
1 parent a856090 commit 772a97f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.Arrays;
import java.util.Objects;

import org.springframework.core.MethodParameter;
Expand Down Expand Up @@ -92,7 +93,8 @@ static void resolveType(ResolvableType[] resolvableTypes, Class<?> contextClass)
resolvableTypes[i] = resolvableType;
}
else if (resolvableTypes[i].hasGenerics()) {
resolveType(resolvableTypes[i].getGenerics(), contextClass);
if(!Arrays.equals(resolvableTypes[i].getGenerics(), resolvableTypes))
resolveType(resolvableTypes[i].getGenerics(), contextClass);
if (resolvableTypes[i].getRawClass() != null)
resolvableTypes[i] = ResolvableType.forClassWithGenerics(Objects.requireNonNull(resolvableTypes[i].getRawClass()), resolvableTypes[i].getGenerics());
}
Expand Down

0 comments on commit 772a97f

Please sign in to comment.