diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 6dd27a80479d..00ca51d028e9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -346,7 +346,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege // specification is aligned with the JSON schema specification. // When "items" is not specified, the elements of the array may be anything at all. if (inner != null) { - inner = ModelUtils.unaliasSchema(this.openAPI, inner); + inner = ModelUtils.unaliasSchema(this.openAPI, inner, schemaMapping); } String typDecl; if (inner != null) { @@ -360,10 +360,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege return "[]" + typDecl; } else if (ModelUtils.isMapSchema(p)) { Schema inner = getAdditionalProperties(p); - return getSchemaType(p) + "[string]" + getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner)); + return getSchemaType(p) + "[string]" + getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner, schemaMapping)); } - //return super.getTypeDeclaration(p); + //return super.getTypeDeclaration(p); // Not using the supertype invocation, because we want to UpperCamelize // the type. String openAPIType = getSchemaType(p); @@ -792,7 +792,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege @Override public String toDefaultValue(Schema schema) { - schema = ModelUtils.unaliasSchema(this.openAPI, schema); + schema = ModelUtils.unaliasSchema(this.openAPI, schema, schemaMapping); if (schema.getDefault() != null) { return schema.getDefault().toString(); } else {