OpenAPITools / OpenAPITools/openapi-generator
[REQ] store and expose via `getApiClient()` the `ApiClient` used to create a library:native Api object
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
most (the base + httpclient, google-api, jersey2/3, okhttp, etc) Api objects expose the ApiClient used to create them via a public ApiClient getApiClient() method. library:native does not which makes it impossible to create additional Api objects from an Api object without using the Configuration.getDefaultApiClient() singleton (which may or may not be what was used to create a particular Api object).
Describe the solution you'd like
add a public ApiClient getApiClient() method to library:native's api.mustache.
Describe alternatives you've considered
passing the ApiClient around and forcing methods to create their own Api wrappers or defaulting to the global singleton Configuration.defaultApiClient.
Additional context
happy to implement this myself. PR forthcoming.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the library:native api.mustache template and compare how other libraries expose their ApiClient. Add the requested public accessor there, then verify that generated native Api objects expose the client used to create them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100