forked from loafle/openapi-generator-original
better default value handling in go generators (#9106)
This commit is contained in:
parent
f66fbf6969
commit
f898bfc7d6
@ -788,6 +788,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toDefaultValue(Schema schema) {
|
public String toDefaultValue(Schema schema) {
|
||||||
|
schema = ModelUtils.unaliasSchema(this.openAPI, schema);
|
||||||
if (schema.getDefault() != null) {
|
if (schema.getDefault() != null) {
|
||||||
return schema.getDefault().toString();
|
return schema.getDefault().toString();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user