OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.44k stars 6.48k forks source link

[REQ] [Python] Add `retries` option to `Configuration` constructor #18920

Closed ogroleg closed 3 months ago

ogroleg commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently, I can't set retries option via the Configuration constructor. I have to write something like this instead:

some_configuration = autogenerated_client.Configuration(host="https://myhost")
some_configuration.retries = 5  # <- extra line of code

some_client = autogenerated_client.ApiClient(some_configuration)

Describe the solution you'd like

I'd like to be able to write something like this - provide retries to the constructor directly:

some_configuration = autogenerated_client.Configuration(host="https://myhost", retries=5)

some_client = autogenerated_client.ApiClient(some_configuration)

I have prepared a PR for this: https://github.com/OpenAPITools/openapi-generator/pull/18919

Describe alternatives you've considered

None.

Additional context

None.