@@ -1595,14 +1595,10 @@ protected void updatePropertyForArray(CodegenProperty property, CodegenProperty
1595
1595
// inner item is Enum
1596
1596
if (isPropertyInnerMostEnum (property )) {
1597
1597
property .isEnum = true ;
1598
- // update datatypeWithEnum for array
1598
+ // update datatypeWithEnum and default value for array
1599
1599
// e.g. List<string> => List<StatusEnum>
1600
1600
updateDataTypeWithEnumForArray (property );
1601
1601
1602
- // TOOD need to revise the default value for enum
1603
- if (property .defaultValue != null ) {
1604
- property .defaultValue = property .defaultValue .replace (property .items .baseType , property .items .datatypeWithEnum );
1605
- }
1606
1602
}
1607
1603
}
1608
1604
}
@@ -1626,15 +1622,9 @@ protected void updatePropertyForMap(CodegenProperty property, CodegenProperty in
1626
1622
// inner item is Enum
1627
1623
if (isPropertyInnerMostEnum (property )) {
1628
1624
property .isEnum = true ;
1629
- // update datatypeWithEnum for map
1625
+ // update datatypeWithEnum and default value for map
1630
1626
// e.g. Dictionary<string, string> => Dictionary<string, StatusEnum>
1631
1627
updateDataTypeWithEnumForMap (property );
1632
-
1633
- // TOOD need to revise the default value for enum
1634
- // set default value
1635
- if (property .defaultValue != null ) {
1636
- property .defaultValue = property .defaultValue .replace (property .items .baseType , property .items .datatypeWithEnum );
1637
- }
1638
1628
}
1639
1629
}
1640
1630
@@ -1667,7 +1657,11 @@ protected void updateDataTypeWithEnumForArray(CodegenProperty property) {
1667
1657
}
1668
1658
// set both datatype and datetypeWithEnum as only the inner type is enum
1669
1659
property .datatypeWithEnum = property .datatypeWithEnum .replace (baseItem .baseType , toEnumName (baseItem ));
1670
- //property.datatype = property.datatypeWithEnum;
1660
+
1661
+ // set default value for variable with inner enum
1662
+ if (property .defaultValue != null ) {
1663
+ property .defaultValue = property .defaultValue .replace (property .items .baseType , toEnumName (property .items ));
1664
+ }
1671
1665
}
1672
1666
1673
1667
/**
@@ -1682,7 +1676,11 @@ protected void updateDataTypeWithEnumForMap(CodegenProperty property) {
1682
1676
}
1683
1677
// set both datatype and datetypeWithEnum as only the inner type is enum
1684
1678
property .datatypeWithEnum = property .datatypeWithEnum .replace (", " + baseItem .baseType , ", " + toEnumName (baseItem ));
1685
- //property.datatype = property.datatypeWithEnum;
1679
+
1680
+ // set default value for variable with inner enum
1681
+ if (property .defaultValue != null ) {
1682
+ property .defaultValue = property .defaultValue .replace (", " + property .items .baseType , ", " + toEnumName (property .items ));
1683
+ }
1686
1684
}
1687
1685
1688
1686
protected void setNonArrayMapProperty (CodegenProperty property , String type ) {
0 commit comments