mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 18:45:23 +00:00
fix compilation error in generated go code (#5061)
This commit is contained in:
parent
6f5f16aaee
commit
ff7203875f
@ -127,14 +127,16 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT
|
||||
{{#queryParams}}
|
||||
{{#required}}
|
||||
{{#isCollectionFormatMulti}}
|
||||
t := *r.{{paramName}}
|
||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||
s := reflect.ValueOf(t)
|
||||
for i := 0; i < s.Len(); i++ {
|
||||
localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
||||
{
|
||||
t := *r.{{paramName}}
|
||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||
s := reflect.ValueOf(t)
|
||||
for i := 0; i < s.Len(); i++ {
|
||||
localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
||||
}
|
||||
} else {
|
||||
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
||||
}
|
||||
} else {
|
||||
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}"))
|
||||
}
|
||||
{{/isCollectionFormatMulti}}
|
||||
{{^isCollectionFormatMulti}}
|
||||
|
@ -1757,14 +1757,16 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo
|
||||
localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv"))
|
||||
localVarQueryParams.Add("http", parameterToString(*r.http, "space"))
|
||||
localVarQueryParams.Add("url", parameterToString(*r.url, "csv"))
|
||||
t := *r.context
|
||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||
s := reflect.ValueOf(t)
|
||||
for i := 0; i < s.Len(); i++ {
|
||||
localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi"))
|
||||
{
|
||||
t := *r.context
|
||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||
s := reflect.ValueOf(t)
|
||||
for i := 0; i < s.Len(); i++ {
|
||||
localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi"))
|
||||
}
|
||||
} else {
|
||||
localVarQueryParams.Add("context", parameterToString(t, "multi"))
|
||||
}
|
||||
} else {
|
||||
localVarQueryParams.Add("context", parameterToString(t, "multi"))
|
||||
}
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
Loading…
Reference in New Issue
Block a user