Skip to content

Commit 137b149

Browse files
authored
Merge pull request #994 from swagger-api/swos-437
fixed build error when array type is present on ref schema
2 parents 6ae37b1 + b02bdc8 commit 137b149

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/swagger/codegen/v3/generators/java/SpringCodegen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.swagger.v3.oas.models.OpenAPI;
2222
import io.swagger.v3.oas.models.Operation;
2323
import io.swagger.v3.oas.models.PathItem;
24+
import io.swagger.v3.oas.models.media.ArraySchema;
2425
import io.swagger.v3.oas.models.media.Schema;
2526
import org.apache.commons.lang3.StringUtils;
2627
import org.slf4j.Logger;
@@ -474,7 +475,7 @@ public CodegenProperty fromProperty(String name, Schema propertySchema) {
474475
CodegenProperty codegenProperty = super.fromProperty(name, propertySchema);
475476
if (propertySchema != null && propertySchema.get$ref() != null) {
476477
Schema refSchema = OpenAPIUtil.getSchemaFromRefSchema(propertySchema, this.openAPI);
477-
if (refSchema != null && !isObjectSchema(refSchema) && refSchema.getEnum() == null) {
478+
if (refSchema != null && !isObjectSchema(refSchema) && !(refSchema instanceof ArraySchema) && refSchema.getEnum() == null) {
478479
setSchemaProperties(name, codegenProperty, refSchema);
479480
processPropertySchemaTypes(name, codegenProperty, refSchema);
480481
}

0 commit comments

Comments
 (0)