From b02bdc86b58909783dec63cfd3e3bebc07873abd Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Tue, 23 Nov 2021 18:14:33 -0500 Subject: [PATCH] fixed build error when array type is present on ref schema --- .../io/swagger/codegen/v3/generators/java/SpringCodegen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/swagger/codegen/v3/generators/java/SpringCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/java/SpringCodegen.java index 111239a356..767e62d1f1 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/java/SpringCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/java/SpringCodegen.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -474,7 +475,7 @@ public CodegenProperty fromProperty(String name, Schema propertySchema) { CodegenProperty codegenProperty = super.fromProperty(name, propertySchema); if (propertySchema != null && propertySchema.get$ref() != null) { Schema refSchema = OpenAPIUtil.getSchemaFromRefSchema(propertySchema, this.openAPI); - if (refSchema != null && !isObjectSchema(refSchema) && refSchema.getEnum() == null) { + if (refSchema != null && !isObjectSchema(refSchema) && !(refSchema instanceof ArraySchema) && refSchema.getEnum() == null) { setSchemaProperties(name, codegenProperty, refSchema); processPropertySchemaTypes(name, codegenProperty, refSchema); }