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
  • #1321
Closed
Open
Issue created Oct 26, 2018 by Administrator@rootContributor

[Golang][client] Allow access to APIClient.cfg.HTTPClient & APIClient.cfg.BasePath

Created by: grokify

Description

There are scenarios where using the raw *HTTP.Client is desirable. This includes:

  1. Scenarios where API definition is not currently supported by OpenAPI Generator and a fallback to native *HTTP.Client with BasePath is necessary. Examples include:
  • requests with multiple multipart/form-data files. Today only one file is supported in APIClient.prepareRequest
  • multipart/mixed responses. This is not handled in client.go's detectContentType
  1. Scenarios where a third-party library uses a *HTTP.Client

Providing access to the *HTTP.Client and Configuration.BasePath is useful in these scenarios.

Of course, we should support the API use cases, but sometimes more invasive changes take longer to implement.

openapi-generator version

master

OpenAPI declaration file content or url
          -
            name: "attachment"
            in: "formData"
            description: "File to upload"
            required: false
            type: "array"
            items:
              type: "file"
Command line used for generation

n/a

Steps to reproduce

n/a

Related issues/PRs
Suggest a fix/enhancement

Either:

  1. Provide an accessor to APIClient.cfg
  2. Provide accessors to APIClient.cfg.HTTPClient and APIClient.cfg.BasePath
Assignee
Assign to
Time tracking