|
5 | 5 | import io.swagger.codegen.v3.CodegenModelType;
|
6 | 6 | import io.swagger.codegen.v3.CodegenProperty;
|
7 | 7 | import io.swagger.codegen.v3.ISchemaHandler;
|
8 |
| -import io.swagger.codegen.v3.generators.util.OpenAPIUtil; |
9 | 8 | import io.swagger.v3.oas.models.media.ArraySchema;
|
10 | 9 | import io.swagger.v3.oas.models.media.ComposedSchema;
|
11 | 10 | import io.swagger.v3.oas.models.media.Schema;
|
@@ -121,7 +120,7 @@ protected CodegenModel processArrayItemSchema(CodegenModel codegenModel, ArraySc
|
121 | 120 | final Schema itemsSchema = arraySchema.getItems();
|
122 | 121 | if (itemsSchema instanceof ComposedSchema) {
|
123 | 122 | final CodegenModel composedModel = this.processComposedSchema(codegenModel.name + ARRAY_ITEMS_SUFFIX, (ComposedSchema) itemsSchema, allModels);
|
124 |
| - this.updateParentModel(codegenModel, composedModel.name, arraySchema); |
| 123 | + this.updateArrayModel(codegenModel, composedModel.name, arraySchema); |
125 | 124 | return composedModel;
|
126 | 125 | }
|
127 | 126 | return null;
|
@@ -210,14 +209,15 @@ protected void updatePropertyDataType(CodegenProperty codegenProperty, String sc
|
210 | 209 | arraySchema.setItems(items);
|
211 | 210 | }
|
212 | 211 |
|
213 |
| - protected void updateParentModel(CodegenModel codegenModel, String schemaName, ArraySchema arraySchema) { |
| 212 | + protected void updateArrayModel(CodegenModel codegenModel, String schemaName, ArraySchema arraySchema) { |
214 | 213 | final Schema items = arraySchema.getItems();
|
215 | 214 | final Schema refSchema = new Schema();
|
216 | 215 | refSchema.set$ref("#/components/schemas/" + schemaName);
|
217 | 216 | arraySchema.setItems(refSchema);
|
218 | 217 |
|
219 | 218 | this.codegenConfig.addParentContainer(codegenModel, codegenModel.name, arraySchema);
|
220 | 219 | codegenModel.defaultValue = this.codegenConfig.toDefaultValue(arraySchema);
|
| 220 | + codegenModel.arrayModelType = this.codegenConfig.fromProperty(codegenModel.name, arraySchema).complexType; |
221 | 221 |
|
222 | 222 | arraySchema.setItems(items);
|
223 | 223 | }
|
|
0 commit comments