fix enum type comparison for string

This commit is contained in:
William Cheng 2020-07-09 11:23:05 +08:00
parent 850c958d83
commit bea6af7f37
2 changed files with 3 additions and 1 deletions

View File

@ -5306,7 +5306,7 @@ public class DefaultCodegen implements CodegenConfig {
if (var.defaultValue != null) {
String enumName = null;
final String enumDefaultValue;
if ("string".equalsIgnoreCase(dataType)) {
if (typeMapping.get("string").equalsIgnoreCase(dataType)) {
enumDefaultValue = toEnumValue(var.defaultValue, dataType);
} else {
enumDefaultValue = var.defaultValue;

View File

@ -158,6 +158,8 @@ public class NimClientCodegen extends DefaultCodegen implements CodegenConfig {
typeMapping.put("DateTime", "string");
typeMapping.put("password", "string");
typeMapping.put("file", "string");
typeMapping.put("string", "string");
}
public void setPackageName(String packageName) {