Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions modules/openapi-generator/src/main/resources/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,18 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
{{#hasFormParams}}
{{#formParams}}
{{#isFile}}
{{^required}}
var localVarFile {{dataType}}
{{^required}}
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() {
localVarFileOk := false
localVarFile, localVarFileOk = localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value().({{dataType}})
if !localVarFileOk {
return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} should be {{dataType}}")
}
}
{{/required}}
{{#required}}
localVarFile = {{paramName}}
{{/required}}
if localVarFile != nil {
fbs, _ := ioutil.ReadAll(localVarFile)
Expand Down Expand Up @@ -298,4 +301,4 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil
}
{{/operation}}
{{/operations}}
{{/operations}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.3-SNAPSHOT
3.1.0-SNAPSHOT
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/MapTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional]
**MapOfEnumString** | **map[string]string** | | [optional]
**DirectMap** | **map[string]bool** | | [optional]
**IndirectMap** | [***StringBooleanMap**](StringBooleanMap.md) | | [optional]
**IndirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/model_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ type MapTest struct {
MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`
MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`
DirectMap map[string]bool `json:"direct_map,omitempty"`
IndirectMap *StringBooleanMap `json:"indirect_map,omitempty"`
IndirectMap StringBooleanMap `json:"indirect_map,omitempty"`
}