diff --git a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache index 583de2dca7c9..5e56b3f4a43d 100644 --- a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache @@ -587,7 +587,25 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re {{paramName}}Param := r.Header.Get("{{baseName}}") {{/isHeaderParam}} {{#isBodyParam}} - {{paramName}}Param := {{dataType}}{} + {{paramName}}Param := {{dataType}}{ + {{#vars}} + {{#defaultValue}} + {{^isArray}} + {{#isBoolean}} + {{name}}: {{{.}}}, + {{/isBoolean}} + {{#isNumeric}} + {{name}}: {{{.}}}, + {{/isNumeric}} + {{^isBoolean}} + {{^isNumeric}} + {{name}}: "{{{.}}}", + {{/isNumeric}} + {{/isBoolean}} + {{/isArray}} + {{/defaultValue}} + {{/vars}} + } d := json.NewDecoder(r.Body) {{^isAdditionalPropertiesTrue}} d.DisallowUnknownFields()