From 798bc64145c4216ae5fa91741f620b4af8378f07 Mon Sep 17 00:00:00 2001 From: ngp-star Date: Mon, 15 Jun 2020 22:12:05 +0530 Subject: [PATCH] fix for operation defination containing ref schema --- .../main/java/org/openapitools/codegen/DefaultCodegen.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;