@@ -1162,7 +1162,7 @@ protected void processOperation(CodegenOperation operation) {
11621162 }
11631163
11641164 String [] nestedTypes = {"List" , "Collection" , "ICollection" , "Dictionary" };
1165- String dataType = getNullablePropertyType (operation .returnProperty .items );
1165+ String dataType = getNullableTypeDeclaration (operation .returnProperty .items );
11661166
11671167 for (String nestedType : nestedTypes ) {
11681168 if (operation .returnType .contains ("<" + nestedType + ">" )) {
@@ -1435,18 +1435,17 @@ private String getArrayTypeDeclaration(Schema arr) {
14351435 String arrayType = typeMapping .get ("array" );
14361436 StringBuilder instantiationType = new StringBuilder (arrayType );
14371437 Schema <?> items = ModelUtils .getSchemaItems (arr );
1438- String nestedType = getNullableSchemaType (items );
14391438
14401439 // TODO: We may want to differentiate here between generics and primitive arrays.
1441- instantiationType .append ("<" ).append (nestedType ).append (">" );
1440+ instantiationType .append ("<" ).append (getNullableTypeDeclaration ( items ) ).append (">" );
14421441 return instantiationType .toString ();
14431442 }
14441443
1445- protected String getNullablePropertyType (CodegenProperty property ) {
1444+ protected String getNullableTypeDeclaration (CodegenProperty property ) {
14461445 return property .dataType ;
14471446 }
14481447
1449- protected String getNullableSchemaType (Schema <?> items ) {
1448+ protected String getNullableTypeDeclaration (Schema <?> items ) {
14501449 return getTypeDeclaration (items );
14511450 }
14521451
@@ -1465,8 +1464,7 @@ public String getTypeDeclaration(Schema p) {
14651464 } else if (ModelUtils .isMapSchema (p )) {
14661465 // Should we also support maps of maps?
14671466 Schema <?> inner = ModelUtils .getAdditionalProperties (p );
1468- String typeDeclaration = getNullableSchemaType (inner );
1469- return getSchemaType (p ) + "<string, " + typeDeclaration + ">" ;
1467+ return getSchemaType (p ) + "<string, " + getNullableTypeDeclaration (inner ) + ">" ;
14701468 }
14711469 return super .getTypeDeclaration (p );
14721470 }
0 commit comments