From 51a75c5481260ce0ef15b8f094ec256c68ac1dfa Mon Sep 17 00:00:00 2001 From: Akhil Nair <36164259+the-akhil-nair@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:20:27 +0530 Subject: [PATCH] [go_pbv_pbr_issue] (#11466) There was a difference in logic for Unmarshalling the JSON. The new logic is re-used here. --- .../src/main/resources/go/model_simple.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index feeefee8875..187abbffe9f 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -314,7 +314,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { {{#deprecated}} // Deprecated {{/deprecated}} - {{name}} {{^required}}{{^isNullable}}*{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` + {{name}} {{^required}}{{^isNullable}}{{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/vars}} }