Skip to content

Commit

Permalink
Add process WildcardElement in generics
Browse files Browse the repository at this point in the history
  • Loading branch information
altro3 committed Jul 16, 2023
1 parent 905b1e9 commit 304f6df
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import io.micronaut.inject.ast.MemberElement;
import io.micronaut.inject.ast.PropertyElement;
import io.micronaut.inject.ast.TypedElement;
import io.micronaut.inject.ast.WildcardElement;
import io.micronaut.inject.visitor.VisitorContext;
import io.micronaut.openapi.javadoc.JavadocDescription;
import io.micronaut.openapi.swagger.core.util.PrimitiveType;
Expand Down Expand Up @@ -770,6 +771,9 @@ protected Schema<?> resolveSchema(OpenAPI openAPI, @Nullable Element definingEle
}

ClassElement componentType = type != null ? type.getFirstTypeArgument().orElse(null) : null;
if (type instanceof WildcardElement wildcardEl) {
type = CollectionUtils.isNotEmpty(wildcardEl.getUpperBounds()) ? wildcardEl.getUpperBounds().get(0) : null;
}
Map<String, ClassElement> typeArgs = type != null ? type.getTypeArguments() : null;

Schema<?> schema = null;
Expand Down

0 comments on commit 304f6df

Please sign in to comment.