better default value handling in go generators (#9106)

This commit is contained in:
William Cheng
2021-03-30 11:09:21 +08:00
committed by GitHub
parent f66fbf6969
commit f898bfc7d6

View File

@@ -788,6 +788,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
@Override
public String toDefaultValue(Schema schema) {
schema = ModelUtils.unaliasSchema(this.openAPI, schema);
if (schema.getDefault() != null) {
return schema.getDefault().toString();
} else {