Skip to content

[Golang] array of interger as parameter to API in spec produces code which will not compile #4265

@antihax

Description

@antihax
Description

Array parameters of integer type produce Go code which will not compile as it attempts to pass []int64 as a string to localVarQueryParams.Add(string,string)

Further, ParameterToString only handles slices of string type objects correctly and not slices of other types; resulting in invalid URI calls.

  I.e. an array of integers result in `?ids=[1 2 3 4]` instead of `?ids=1,2,3,4`
Swagger-codegen version

master branch HEAD.

Swagger declaration file content
                "parameters":[  
               {  

                  "in":"query",
                  "items":{  
                     "format":"int64",
                     "type":"integer"
                  },
                  "minItems":1,
                  "name":"ids",
                  "required":true,
                  "type":"array"
               }]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions