@@ -2490,7 +2490,13 @@ protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map<S
24902490 if (StringUtils .isBlank (interfaceSchema .get$ref ())) {
24912491 // primitive type
24922492 String languageType = getTypeDeclaration (interfaceSchema );
2493- addImports (m .imports , fromProperty (languageType , interfaceSchema ));
2493+ CodegenProperty interfaceProperty = fromProperty (languageType , interfaceSchema );
2494+ if (ModelUtils .isArraySchema (interfaceSchema ) || ModelUtils .isMapSchema (interfaceSchema )) {
2495+ while (interfaceProperty != null ) {
2496+ addImport (m , interfaceProperty .complexType );
2497+ interfaceProperty = interfaceProperty .items ;
2498+ }
2499+ }
24942500
24952501 if (composed .getAnyOf () != null ) {
24962502 if (m .anyOf .contains (languageType )) {
@@ -6371,7 +6377,11 @@ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set
63716377 // default to csv:
63726378 codegenParameter .collectionFormat = StringUtils .isEmpty (collectionFormat ) ? "csv" : collectionFormat ;
63736379
6374- addImports (imports , arrayInnerProperty );
6380+ // recursively add import
6381+ while (arrayInnerProperty != null ) {
6382+ imports .add (arrayInnerProperty .baseType );
6383+ arrayInnerProperty = arrayInnerProperty .items ;
6384+ }
63756385 } else {
63766386 // referenced schemas
63776387 ;
@@ -6398,7 +6408,10 @@ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set
63986408 codegenParameter .enumName = codegenProperty .enumName ;
63996409 }
64006410
6401- addImports (imports , codegenProperty );
6411+ // import
6412+ if (codegenProperty .complexType != null ) {
6413+ imports .add (codegenProperty .complexType );
6414+ }
64026415
64036416 setParameterExampleValue (codegenParameter );
64046417 // set nullable
0 commit comments