diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 62e364e82f98..0d9547e2dd91 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -3909,7 +3909,11 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { } } else { if (cp.complexType != null) { - r.baseType = cp.complexType; + if (cp.items != null) { + r.baseType = cp.items.complexType; + } else { + r.baseType = cp.complexType; + } r.isModel = true; } else { r.baseType = cp.baseType;