Open GyoOkuda opened 3 years ago
I believe all of these settings can be specified on the Session
object directly; after #39 I think a better solution would be something like this:
def my_session_factory() -> requests.Session:
session = requests.Session()
session.verify = True
session.proxy = "https://some.proxy.org"
session.cert = ("/path/to/cert", "/path/to/key")
return session
spec = OpenAPI(some_yaml, session_factory=my_session_factory)
Currently, openapi3 doesn't honor HTTP_PROXY/HTTPS_PROXY environment variable. and, no another way to set http proxy / ca_bundle in openapi3.
As Described in https://github.com/psf/requests/issues/2807#issuecomment-1462910095 , to honor environment variable, environment setting dict should be taken from requests.Session.merge_environment_settings , and requests.Session.send should be called with it.