File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
src/openapi_python_generator/language_converters/python/templates Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11{% if env_token_name is not none %} import os{% endif %}
22
3- from typing import Optional
3+ from typing import Optional, Union
44
55class APIConfig():
66 base_path: str = '{{ servers[0] .url }}'
7+ verify: Union[bool, str] = True
78{% if env_token_name is none %}
89 _access_token : Optional[str] = None
910{% endif %}
Original file line number Diff line number Diff line change 1515 query_params = {key:value for (key,value) in query_params.items() if value is not None}
1616
1717 {% if async_client %}
18- async with httpx.AsyncClient(base_url=base_path) as client:
18+ async with httpx.AsyncClient(base_url=base_path, verify=APIConfig.verify ) as client:
1919 response = await client.request(
2020 {% else %}
21- with httpx.Client(base_url=base_path) as client:
21+ with httpx.Client(base_url=base_path, verify=APIConfig.verify ) as client:
2222 response = client.request(
2323 {% endif %}
2424 '{{ method }}',
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ def {{ operation_id }}({{ params }}) -> {% if return_type.type is none or return
1919 f'{base_path}{path}',
2020 headers=headers,
2121 params=query_params,
22+ verify=APIConfig.verify,
2223 {% if body_param %}
2324 {% if use_orjson %}
2425 content=orjson.dumps({{ body_param }})
You can’t perform that action at this time.
0 commit comments