forked from loafle/openapi-generator-original
Fix defaultValue for String schama in Dart (#1342)
This commit is contained in:
parent
02e85cc417
commit
521f5fafa3
@ -313,6 +313,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (schema.getDefault() != null) {
|
if (schema.getDefault() != null) {
|
||||||
|
if (ModelUtils.isStringSchema(schema)) {
|
||||||
|
return "\"" + schema.getDefault().toString().replaceAll("\"", "\\\"") + "\"";
|
||||||
|
}
|
||||||
return schema.getDefault().toString();
|
return schema.getDefault().toString();
|
||||||
} else {
|
} else {
|
||||||
return "null";
|
return "null";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user