Closed
Description
Problem statement
Compilation of generated code fails if an API method contains a parameter named 'result'.
Swagger specification
/some/api/path:
get:
description: "Something"
operationId: SomeOperation
tags: ['sometag']
produces:
- application/json
parameters:
- {$ref: '#/parameters/page'}
- {$ref: '#/parameters/pagesize'}
- name: type
in: query
description: some description of type parameter
type: array
items:
type: string
collectionFormat: csv
- name: result
in: query
description: some description of result parameter
type: array
items:
type: boolean
collectionFormat: csv
Steps to reproduce
Generate the spec and try to compile the code.
Environment
swagger version: 0.17.2
go version: 1.11.1
OS: Windows 10, Ubuntu 14
Additional
Problem lies in method Build() :
result.Path = golangswaggerpaths.Join(_basePath, _path)
...
result := swag.JoinByFormat(resultIR, "")
if len(result) > 0 {
qsv := result[0]
if qsv != "" {
qs.Set("result", qsv)
}
}