Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed build error when array type is present on ref schema #994

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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