[BUG][GO][CLIENT] Compilation failure when multiple multi params
Created by: qmuntal
Version 4.1.1
Command line used for generation openapi-generator generate -i swagger.yaml -g go-o ./
Spec
swagger: "2.0"
info:
title: Foo
version: v1
paths:
/foo:
post:
operationId: fooPost
parameters:
-
name: user_ids[]
in: query
required: false
type: array
items:
type: string
collectionFormat: multi
-
name: user_names[]
in: query
required: false
type: array
items:
type: string
collectionFormat: multi
responses:
200:
description: "successful operation"
Description
The Go client code generation is adding duplicated reflect
imports for each parameter of type array multi. The above spec produces the following import:
import (
_context "context"
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"reflect"
"github.com/antihax/optional"
"reflect"
)
This bug was introduced in the PR #3390 (source code)