Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3835
Closed
Open
Issue created Sep 05, 2019 by Administrator@rootContributor

[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)

Assignee
Assign to
Time tracking