swagger-api / swagger-api/swagger-codegen

Python: Cannot configure urllib3 retry behavior

Open
#12,127 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I'm attempting to change the backoff policy for urllib3. This is supported behavior on both the request and the pool. (docs). Because RESTClientObject doesn't allow specifying addition_pool_args, there's no way to configure that.

Swagger-codegen version

2.4.31

Command line used for generation

swagger-codegen generate -i http://localhost:8080/swagger.json -l python -o api_client/ -c swagger_config.json

Swagger config:

{
        "packageName": "drone_client",
        "projectName": "drone_api"
}
Steps to reproduce

Nothing special. Any python client should do this.

Related issues/PRs

I couldn't find any.

Suggest a fix/enhancement

Allow me to pass in additional options which are passed to the pool, or at minimum, specify a Retry object.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the generated Python client's RESTClientObject and compare its urllib3 pool configuration with the urllib3 Retry documentation linked in the issue. Determine how to expose additional pool options or a Retry object, then verify that a generated Python client can configure the requested backoff policy.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.