Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
grokify opened this issue Oct 26, 2018 · 0 comments · Fixed by #3976
Closed

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

grokify opened this issue Oct 26, 2018 · 0 comments · Fixed by #3976

Comments

@grokify
Copy link
Member

grokify commented Oct 26, 2018

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
@grokify grokify changed the title [Golang][client] Allow external use by providing access to APIClient.cfg.HTTPClient & APIClient.cfg.BasePath [Golang][client] Allow access to APIClient.cfg.HTTPClient & APIClient.cfg.BasePath Oct 26, 2018
wing328 pushed a commit that referenced this issue Oct 21, 2019
…3976)

* Allow retrieving the underlying configuration for APIClient

  - Needed for dynamically changing the underlying implementations and
    for testing
  - Fixes #1321 and #3412

* Added go-petstore-withXml changes suggested by circleci

* Add caution note about modifying configuration while live
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant