Fix defaultValue for String schama in Dart (#1342)

This commit is contained in:
Ysawa 2018-11-01 18:50:01 +09:00 committed by William Cheng
parent 02e85cc417
commit 521f5fafa3

View File

@ -313,6 +313,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
}
if (schema.getDefault() != null) {
if (ModelUtils.isStringSchema(schema)) {
return "\"" + schema.getDefault().toString().replaceAll("\"", "\\\"") + "\"";
}
return schema.getDefault().toString();
} else {
return "null";