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
20.56k stars 6.28k forks source link

[Python] Add retries option to Configuration constructor #18919

Closed ogroleg closed 2 weeks ago

ogroleg commented 2 weeks ago

Currently, python client supports retries option but there is no way to set it via Configuration constructor. This PR adds retries to the Configuration constructor to simplify its usage.

Before:

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

some_client = autogenerated_client.ApiClient(some_configuration)

After:

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

some_client = autogenerated_client.ApiClient(some_configuration)

closes https://github.com/OpenAPITools/openapi-generator/issues/18920

PR checklist

ogroleg commented 2 weeks ago

cc Python technical committee: @cbornet @tomplus @krjakbrjak @fa0311 @multani

wing328 commented 2 weeks ago

lgtm. thanks for the PR