Skip to content

generated client doesn't support proxies #773

Closed
@leifwalsh

Description

@leifwalsh

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

The generated client is nice - clean, ergonomic, and lean - but it doesn't provide the full ability to pass arguments through to httpx. In the case I care about right now, I need to pass a proxy configuration to it (and I need to do so in code, I cannot rely on environment variables for an uninteresting reason, which is that I need one application to use different proxies in different places).

Describe the solution you'd like

I believe something like #202 would help, but I'm open to other ideas. It occurs to me that the format of the proxies dict that httpx accepts is actually itself an implementation detail specific to httpx. requests, for example, uses keys like http and https while httpx's proxy keys are http:// and https://.

Describe alternatives you've considered

So far I've customized the client.py.jinja and endpoint_module.py.jinja templates in the obvious way, and it works, but I don't want to be subject to bugs if the templates change in future versions, I'd rather openapi-python-client intentionally support some form of proxy config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions