Skip to content

Commit e88dc24

Browse files
committed
Merge branch 'issue-7311' of https://github.com/ffddorf/swagger-codegen into ffddorf-issue-7311
# Conflicts: # modules/swagger-codegen/src/main/resources/go/api.mustache
2 parents 179bd2a + 0ab08a1 commit e88dc24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/swagger-codegen/src/main/resources/go/api.mustache

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
149149
{{#hasFormParams}}
150150
{{#formParams}}
151151
{{#isFile}}
152-
var localVarFile {{dataType}}
152+
{{#required}}
153+
localVarFile := {{paramName}}
154+
{{/required}}
153155
{{^required}}
156+
var localVarFile {{dataType}}
154157
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() {
155158
localVarFileOk := false
156159
localVarFile, localVarFileOk = localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value().({{dataType}})

0 commit comments

Comments
 (0)