Skip to content

Commit

Permalink
Merge pull request spring-io#994 from swagger-api/swos-437
Browse files Browse the repository at this point in the history
fixed build error when array type is present on ref schema
  • Loading branch information
HugoMario authored Nov 23, 2021
2 parents 6ae37b1 + b02bdc8 commit 137b149
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 137b149

Please sign in to comment.