From 63b3e27994aae29802a6477c96952c11927e526c Mon Sep 17 00:00:00 2001 From: timonrieger Date: Sat, 21 Feb 2026 00:35:17 +0100 Subject: [PATCH 1/5] templates --- .../python-pydantic-v1/configuration.mustache | 53 +++++++++++++------ .../resources/python/configuration.mustache | 47 +++++++++++----- 2 files changed, 72 insertions(+), 28 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache index f074f48e98ff..22fc804d67df 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache @@ -47,8 +47,23 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). + :param cert_file: The path to a client certificate file, for mTLS. + :param key_file: The path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. {{#hasAuthMethods}} :Example: @@ -146,7 +161,13 @@ conf = {{{packageName}}}.Configuration( {{/hasHttpSignatureMethods}} server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, + verify_ssl=True, ssl_ca_cert=None, + retries=None, cert_file=None, key_file=None, + assert_hostname=None, tls_server_name=None, + connection_pool_maxsize=None, proxy=None, proxy_headers=None, + safe_chars_for_path_param='', client_side_validation=True, + socket_options=None, + datetime_format="{{{datetimeFormat}}}", date_format="{{{dateFormat}}}", ) -> None: """Constructor """ @@ -215,7 +236,7 @@ conf = {{{packageName}}}.Configuration( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -223,28 +244,28 @@ conf = {{{packageName}}}.Configuration( self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = None + self.cert_file = cert_file """client certificate file """ - self.key_file = None + self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ {{#asyncio}} - self.connection_pool_maxsize = 100 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ {{/asyncio}} {{^asyncio}} - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -253,30 +274,30 @@ conf = {{{packageName}}}.Configuration( """ {{/asyncio}} - self.proxy = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "{{{datetimeFormat}}}" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "{{{dateFormat}}}" + self.date_format = date_format """date format """ diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 52fb8a940b6f..b7f024841c71 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -183,6 +183,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. {{#async}} @@ -195,6 +197,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. {{#hasAuthMethods}} :Example: @@ -299,11 +311,22 @@ conf = {{{packageName}}}.Configuration( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="{{{datetimeFormat}}}", + date_format: str="{{{dateFormat}}}", *, debug: Optional[bool] = None, ) -> None: @@ -382,7 +405,7 @@ conf = {{{packageName}}}.Configuration( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -400,22 +423,22 @@ conf = {{{packageName}}}.Configuration( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ {{#async}} - self.connection_pool_maxsize = 100 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ {{/async}} {{^async}} - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -424,30 +447,30 @@ conf = {{{packageName}}}.Configuration( """ {{/async}} - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "{{{datetimeFormat}}}" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "{{{dateFormat}}}" + self.date_format = date_format """date format """ From 794810350d5dfd3c2242ce533bba6fac95e55559 Mon Sep 17 00:00:00 2001 From: timonrieger Date: Sat, 21 Feb 2026 00:36:51 +0100 Subject: [PATCH 2/5] samples --- .../openapi_client/configuration.py | 45 ++++++++++++---- .../openapi_client/configuration.py | 51 +++++++++++++------ .../python/openapi_client/configuration.py | 45 ++++++++++++---- .../petstore_api/configuration.py | 45 ++++++++++++---- .../petstore_api/configuration.py | 45 ++++++++++++---- .../petstore_api/configuration.py | 45 ++++++++++++---- .../petstore_api/configuration.py | 51 +++++++++++++------ .../petstore_api/configuration.py | 51 +++++++++++++------ .../python/petstore_api/configuration.py | 45 ++++++++++++---- 9 files changed, 312 insertions(+), 111 deletions(-) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py index d266e7a8c2cc..668ea3f259f2 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py @@ -158,6 +158,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -165,6 +167,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -200,11 +212,22 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: @@ -274,7 +297,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -292,15 +315,15 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -308,30 +331,30 @@ def __init__( cpu_count * 5 is used as default value to increase performance. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py index 7c6f3e11f99f..9a920c1aed0b 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py @@ -51,8 +51,23 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). + :param cert_file: The path to a client certificate file, for mTLS. + :param key_file: The path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -81,7 +96,13 @@ def __init__(self, host=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, + verify_ssl=True, ssl_ca_cert=None, + retries=None, cert_file=None, key_file=None, + assert_hostname=None, tls_server_name=None, + connection_pool_maxsize=None, proxy=None, proxy_headers=None, + safe_chars_for_path_param='', client_side_validation=True, + socket_options=None, + datetime_format="%Y-%m-%dT%H:%M:%S.%f%z", date_format="%Y-%m-%d", ) -> None: """Constructor """ @@ -143,7 +164,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -151,21 +172,21 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = None + self.cert_file = cert_file """client certificate file """ - self.key_file = None + self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -173,30 +194,30 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/client/echo_api/python/openapi_client/configuration.py b/samples/client/echo_api/python/openapi_client/configuration.py index d266e7a8c2cc..668ea3f259f2 100644 --- a/samples/client/echo_api/python/openapi_client/configuration.py +++ b/samples/client/echo_api/python/openapi_client/configuration.py @@ -158,6 +158,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -165,6 +167,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -200,11 +212,22 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: @@ -274,7 +297,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -292,15 +315,15 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -308,30 +331,30 @@ def __init__( cpu_count * 5 is used as default value to increase performance. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py index 9b291293704f..e73fdfa2cb74 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py @@ -163,6 +163,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. @@ -170,6 +172,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -264,11 +276,22 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: @@ -342,7 +365,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -360,43 +383,43 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = 100 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py index 9b291293704f..e73fdfa2cb74 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py @@ -163,6 +163,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. @@ -170,6 +172,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -264,11 +276,22 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: @@ -342,7 +365,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -360,43 +383,43 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = 100 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py index 7ff577c2f915..a6fa4040c716 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py @@ -164,6 +164,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -171,6 +173,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -265,11 +277,22 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: @@ -344,7 +367,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -362,15 +385,15 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -378,30 +401,30 @@ def __init__( cpu_count * 5 is used as default value to increase performance. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py index 1e0b9acbc97c..cef0eef31950 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py @@ -51,8 +51,23 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). + :param cert_file: The path to a client certificate file, for mTLS. + :param key_file: The path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -140,7 +155,13 @@ def __init__(self, host=None, signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, + verify_ssl=True, ssl_ca_cert=None, + retries=None, cert_file=None, key_file=None, + assert_hostname=None, tls_server_name=None, + connection_pool_maxsize=None, proxy=None, proxy_headers=None, + safe_chars_for_path_param='', client_side_validation=True, + socket_options=None, + datetime_format="%Y-%m-%dT%H:%M:%S.%f%z", date_format="%Y-%m-%d", ) -> None: """Constructor """ @@ -207,7 +228,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -215,49 +236,49 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = None + self.cert_file = cert_file """client certificate file """ - self.key_file = None + self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = 100 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ - self.proxy = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py index 8bca6dc7ab0e..4697b33d6cca 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py @@ -52,8 +52,23 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). + :param cert_file: The path to a client certificate file, for mTLS. + :param key_file: The path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -141,7 +156,13 @@ def __init__(self, host=None, signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, + verify_ssl=True, ssl_ca_cert=None, + retries=None, cert_file=None, key_file=None, + assert_hostname=None, tls_server_name=None, + connection_pool_maxsize=None, proxy=None, proxy_headers=None, + safe_chars_for_path_param='', client_side_validation=True, + socket_options=None, + datetime_format="%Y-%m-%dT%H:%M:%S.%f%z", date_format="%Y-%m-%d", ) -> None: """Constructor """ @@ -208,7 +229,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -216,21 +237,21 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = None + self.cert_file = cert_file """client certificate file """ - self.key_file = None + self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -238,30 +259,30 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 7ff577c2f915..a6fa4040c716 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -164,6 +164,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: int | urllib3.util.retry.Retry - Retry configuration. @@ -171,6 +173,16 @@ class Configuration: in PEM (str) or DER (bytes) format. :param cert_file: the path to a client certificate file, for mTLS. :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: @@ -265,11 +277,22 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, + verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", *, debug: Optional[bool] = None, ) -> None: @@ -344,7 +367,7 @@ def __init__( """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -362,15 +385,15 @@ def __init__( self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -378,30 +401,30 @@ def __init__( cpu_count * 5 is used as default value to increase performance. """ - self.proxy: Optional[str] = None + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ From b536ae8a93ac6abd2337a1635fc0734bff21156d Mon Sep 17 00:00:00 2001 From: timonrieger Date: Sat, 21 Feb 2026 00:49:52 +0100 Subject: [PATCH 3/5] scope to python generator --- .../python-pydantic-v1/configuration.mustache | 34 ++++++++----------- .../openapi_client/configuration.py | 32 +++++++---------- .../petstore_api/configuration.py | 32 +++++++---------- .../petstore_api/configuration.py | 32 +++++++---------- 4 files changed, 53 insertions(+), 77 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache index 22fc804d67df..e09d392afc7a 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache @@ -162,12 +162,6 @@ conf = {{{packageName}}}.Configuration( server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, verify_ssl=True, ssl_ca_cert=None, - retries=None, cert_file=None, key_file=None, - assert_hostname=None, tls_server_name=None, - connection_pool_maxsize=None, proxy=None, proxy_headers=None, - safe_chars_for_path_param='', client_side_validation=True, - socket_options=None, - datetime_format="{{{datetimeFormat}}}", date_format="{{{dateFormat}}}", ) -> None: """Constructor """ @@ -244,28 +238,28 @@ conf = {{{packageName}}}.Configuration( self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = cert_file + self.cert_file = None """client certificate file """ - self.key_file = key_file + self.key_file = None """client key file """ - self.assert_hostname = assert_hostname + self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = tls_server_name + self.tls_server_name = None """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ {{#asyncio}} - self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 + self.connection_pool_maxsize = 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ {{/asyncio}} {{^asyncio}} - self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -274,30 +268,30 @@ conf = {{{packageName}}}.Configuration( """ {{/asyncio}} - self.proxy = proxy + self.proxy = None """Proxy URL """ - self.proxy_headers = proxy_headers + self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = safe_chars_for_path_param + self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = retries + self.retries = None """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = client_side_validation + self.client_side_validation = True - self.socket_options = socket_options + self.socket_options = None """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = datetime_format + self.datetime_format = "{{{datetimeFormat}}}" """datetime format """ - self.date_format = date_format + self.date_format = "{{{dateFormat}}}" """date format """ diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py index 9a920c1aed0b..add2d6211271 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py @@ -97,12 +97,6 @@ def __init__(self, host=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, verify_ssl=True, ssl_ca_cert=None, - retries=None, cert_file=None, key_file=None, - assert_hostname=None, tls_server_name=None, - connection_pool_maxsize=None, proxy=None, proxy_headers=None, - safe_chars_for_path_param='', client_side_validation=True, - socket_options=None, - datetime_format="%Y-%m-%dT%H:%M:%S.%f%z", date_format="%Y-%m-%d", ) -> None: """Constructor """ @@ -172,21 +166,21 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = cert_file + self.cert_file = None """client certificate file """ - self.key_file = key_file + self.key_file = None """client key file """ - self.assert_hostname = assert_hostname + self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = tls_server_name + self.tls_server_name = None """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -194,30 +188,30 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = proxy + self.proxy = None """Proxy URL """ - self.proxy_headers = proxy_headers + self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = safe_chars_for_path_param + self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = retries + self.retries = None """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = client_side_validation + self.client_side_validation = True - self.socket_options = socket_options + self.socket_options = None """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = datetime_format + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" """datetime format """ - self.date_format = date_format + self.date_format = "%Y-%m-%d" """date format """ diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py index cef0eef31950..91fd4d2188c7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py @@ -156,12 +156,6 @@ def __init__(self, host=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, verify_ssl=True, ssl_ca_cert=None, - retries=None, cert_file=None, key_file=None, - assert_hostname=None, tls_server_name=None, - connection_pool_maxsize=None, proxy=None, proxy_headers=None, - safe_chars_for_path_param='', client_side_validation=True, - socket_options=None, - datetime_format="%Y-%m-%dT%H:%M:%S.%f%z", date_format="%Y-%m-%d", ) -> None: """Constructor """ @@ -236,49 +230,49 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = cert_file + self.cert_file = None """client certificate file """ - self.key_file = key_file + self.key_file = None """client key file """ - self.assert_hostname = assert_hostname + self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = tls_server_name + self.tls_server_name = None """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 + self.connection_pool_maxsize = 100 """This value is passed to the aiohttp to limit simultaneous connections. Default values is 100, None means no-limit. """ - self.proxy = proxy + self.proxy = None """Proxy URL """ - self.proxy_headers = proxy_headers + self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = safe_chars_for_path_param + self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = retries + self.retries = None """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = client_side_validation + self.client_side_validation = True - self.socket_options = socket_options + self.socket_options = None """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = datetime_format + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" """datetime format """ - self.date_format = date_format + self.date_format = "%Y-%m-%d" """date format """ diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py index 4697b33d6cca..e3ce82ac65d3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py @@ -157,12 +157,6 @@ def __init__(self, host=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, verify_ssl=True, ssl_ca_cert=None, - retries=None, cert_file=None, key_file=None, - assert_hostname=None, tls_server_name=None, - connection_pool_maxsize=None, proxy=None, proxy_headers=None, - safe_chars_for_path_param='', client_side_validation=True, - socket_options=None, - datetime_format="%Y-%m-%dT%H:%M:%S.%f%z", date_format="%Y-%m-%d", ) -> None: """Constructor """ @@ -237,21 +231,21 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = cert_file + self.cert_file = None """client certificate file """ - self.key_file = key_file + self.key_file = None """client key file """ - self.assert_hostname = assert_hostname + self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = tls_server_name + self.tls_server_name = None """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel @@ -259,30 +253,30 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = proxy + self.proxy = None """Proxy URL """ - self.proxy_headers = proxy_headers + self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = safe_chars_for_path_param + self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = retries + self.retries = None """Adding retries to override urllib3 default value 3 """ # Enable client side validation - self.client_side_validation = client_side_validation + self.client_side_validation = True - self.socket_options = socket_options + self.socket_options = None """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = datetime_format + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" """datetime format """ - self.date_format = date_format + self.date_format = "%Y-%m-%d" """date format """ From bb0ead068313bbebb0d03d3b17a175cd66c31906 Mon Sep 17 00:00:00 2001 From: timonrieger Date: Sat, 21 Feb 2026 01:00:05 +0100 Subject: [PATCH 4/5] address suggestions --- .../python-pydantic-v1/configuration.mustache | 2 +- .../src/main/resources/python/configuration.mustache | 11 ++++------- .../openapi_client/configuration.py | 9 +++------ .../openapi_client/configuration.py | 2 +- .../echo_api/python/openapi_client/configuration.py | 9 +++------ .../python-aiohttp/petstore_api/configuration.py | 6 +++--- .../python-httpx/petstore_api/configuration.py | 6 +++--- .../python-lazyImports/petstore_api/configuration.py | 9 +++------ .../petstore_api/configuration.py | 2 +- .../python-pydantic-v1/petstore_api/configuration.py | 2 +- .../petstore/python/petstore_api/configuration.py | 9 +++------ 11 files changed, 26 insertions(+), 41 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache index e09d392afc7a..36203c9da68d 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache @@ -161,7 +161,7 @@ conf = {{{packageName}}}.Configuration( {{/hasHttpSignatureMethods}} server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - verify_ssl=True, ssl_ca_cert=None, + ssl_ca_cert=None, verify_ssl=True, ) -> None: """Constructor """ diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index b7f024841c71..a9485f501930 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -199,7 +199,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -311,12 +311,12 @@ conf = {{{packageName}}}.Configuration( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -434,16 +434,13 @@ conf = {{{packageName}}}.Configuration( {{#async}} self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. + None in the constructor is coerced to default 100. """ {{/async}} {{^async}} self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. + per pool. None in the constructor is coerced to cpu_count * 5. """ {{/async}} diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py index 668ea3f259f2..dadceb2e17dc 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/configuration.py @@ -169,7 +169,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -212,12 +212,12 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -325,10 +325,7 @@ def __init__( self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. + per pool. None in the constructor is coerced to cpu_count * 5. """ self.proxy = proxy diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py index add2d6211271..0e9772d95550 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py @@ -96,7 +96,7 @@ def __init__(self, host=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - verify_ssl=True, ssl_ca_cert=None, + ssl_ca_cert=None, verify_ssl=True, ) -> None: """Constructor """ diff --git a/samples/client/echo_api/python/openapi_client/configuration.py b/samples/client/echo_api/python/openapi_client/configuration.py index 668ea3f259f2..dadceb2e17dc 100644 --- a/samples/client/echo_api/python/openapi_client/configuration.py +++ b/samples/client/echo_api/python/openapi_client/configuration.py @@ -169,7 +169,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -212,12 +212,12 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -325,10 +325,7 @@ def __init__( self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. + per pool. None in the constructor is coerced to cpu_count * 5. """ self.proxy = proxy diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py index e73fdfa2cb74..8051644c0f00 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py @@ -174,7 +174,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -276,12 +276,12 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -393,7 +393,7 @@ def __init__( self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. + None in the constructor is coerced to default 100. """ self.proxy = proxy diff --git a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py index e73fdfa2cb74..8051644c0f00 100644 --- a/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-httpx/petstore_api/configuration.py @@ -174,7 +174,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -276,12 +276,12 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -393,7 +393,7 @@ def __init__( self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 """This value is passed to the aiohttp to limit simultaneous connections. - Default values is 100, None means no-limit. + None in the constructor is coerced to default 100. """ self.proxy = proxy diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py index a6fa4040c716..cc520e4f8902 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py @@ -175,7 +175,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -277,12 +277,12 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -395,10 +395,7 @@ def __init__( self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. + per pool. None in the constructor is coerced to cpu_count * 5. """ self.proxy = proxy diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py index 91fd4d2188c7..0869ac66c9ff 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py @@ -155,7 +155,7 @@ def __init__(self, host=None, signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - verify_ssl=True, ssl_ca_cert=None, + ssl_ca_cert=None, verify_ssl=True, ) -> None: """Constructor """ diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py index e3ce82ac65d3..07b49fb7095f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py @@ -156,7 +156,7 @@ def __init__(self, host=None, signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - verify_ssl=True, ssl_ca_cert=None, + ssl_ca_cert=None, verify_ssl=True, ) -> None: """Constructor """ diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index a6fa4040c716..cc520e4f8902 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -175,7 +175,7 @@ class Configuration: :param key_file: the path to a client key file, for mTLS. :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for async, cpu_count * 5 for sync. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. :param proxy: Proxy URL. :param proxy_headers: Proxy headers. :param safe_chars_for_path_param: Safe characters for path parameter encoding. @@ -277,12 +277,12 @@ def __init__( server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, - verify_ssl: bool=True, ssl_ca_cert: Optional[str]=None, retries: Optional[Union[int, Any]] = None, ca_cert_data: Optional[Union[str, bytes]] = None, cert_file: Optional[str]=None, key_file: Optional[str]=None, + verify_ssl: bool=True, assert_hostname: Optional[bool]=None, tls_server_name: Optional[str]=None, connection_pool_maxsize: Optional[int]=None, @@ -395,10 +395,7 @@ def __init__( self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. + per pool. None in the constructor is coerced to cpu_count * 5. """ self.proxy = proxy From c4f0cc3eed8a93cc56040e927831a2f6eaeadd4f Mon Sep 17 00:00:00 2001 From: timonrieger Date: Sat, 21 Feb 2026 01:16:05 +0100 Subject: [PATCH 5/5] revert pydantic-v1 --- .../python-pydantic-v1/configuration.mustache | 21 +++---------------- .../openapi_client/configuration.py | 21 +++---------------- .../petstore_api/configuration.py | 21 +++---------------- .../petstore_api/configuration.py | 21 +++---------------- 4 files changed, 12 insertions(+), 72 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache index 36203c9da68d..70d24e10f414 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache @@ -47,23 +47,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. - :param verify_ssl: bool - Set this to false to skip verifying SSL certificate - when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). - :param cert_file: The path to a client certificate file, for mTLS. - :param key_file: The path to a client key file, for mTLS. - :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. - :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. - :param proxy: Proxy URL. - :param proxy_headers: Proxy headers. - :param safe_chars_for_path_param: Safe characters for path parameter encoding. - :param client_side_validation: Enable client-side validation. Default True. - :param socket_options: Options to pass down to the underlying urllib3 socket. - :param datetime_format: Datetime format string for serialization. - :param date_format: Date format string for serialization. {{#hasAuthMethods}} :Example: @@ -161,7 +146,7 @@ conf = {{{packageName}}}.Configuration( {{/hasHttpSignatureMethods}} server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, verify_ssl=True, + ssl_ca_cert=None, ) -> None: """Constructor """ @@ -230,7 +215,7 @@ conf = {{{packageName}}}.Configuration( """Debug switch """ - self.verify_ssl = verify_ssl + self.verify_ssl = True """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -628,4 +613,4 @@ conf = {{{packageName}}}.Configuration( def host(self, value): """Fix base path.""" self._base_path = value - self.server_index = None + self.server_index = None \ No newline at end of file diff --git a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py index 0e9772d95550..3934cac8dd35 100644 --- a/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py +++ b/samples/client/echo_api/python-pydantic-v1/openapi_client/configuration.py @@ -51,23 +51,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. - :param verify_ssl: bool - Set this to false to skip verifying SSL certificate - when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). - :param cert_file: The path to a client certificate file, for mTLS. - :param key_file: The path to a client key file, for mTLS. - :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. - :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. - :param proxy: Proxy URL. - :param proxy_headers: Proxy headers. - :param safe_chars_for_path_param: Safe characters for path parameter encoding. - :param client_side_validation: Enable client-side validation. Default True. - :param socket_options: Options to pass down to the underlying urllib3 socket. - :param datetime_format: Datetime format string for serialization. - :param date_format: Date format string for serialization. :Example: @@ -96,7 +81,7 @@ def __init__(self, host=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, verify_ssl=True, + ssl_ca_cert=None, ) -> None: """Constructor """ @@ -158,7 +143,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = verify_ssl + self.verify_ssl = True """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -478,4 +463,4 @@ def host(self): def host(self, value): """Fix base path.""" self._base_path = value - self.server_index = None + self.server_index = None \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py index 0869ac66c9ff..deabb614675a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/configuration.py @@ -51,23 +51,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. - :param verify_ssl: bool - Set this to false to skip verifying SSL certificate - when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). - :param cert_file: The path to a client certificate file, for mTLS. - :param key_file: The path to a client key file, for mTLS. - :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. - :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. - :param proxy: Proxy URL. - :param proxy_headers: Proxy headers. - :param safe_chars_for_path_param: Safe characters for path parameter encoding. - :param client_side_validation: Enable client-side validation. Default True. - :param socket_options: Options to pass down to the underlying urllib3 socket. - :param datetime_format: Datetime format string for serialization. - :param date_format: Date format string for serialization. :Example: @@ -155,7 +140,7 @@ def __init__(self, host=None, signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, verify_ssl=True, + ssl_ca_cert=None, ) -> None: """Constructor """ @@ -222,7 +207,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = verify_ssl + self.verify_ssl = True """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -613,4 +598,4 @@ def host(self): def host(self, value): """Fix base path.""" self._base_path = value - self.server_index = None + self.server_index = None \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py index 07b49fb7095f..df167c124dc6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/configuration.py @@ -52,23 +52,8 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. - :param verify_ssl: bool - Set this to false to skip verifying SSL certificate - when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: Retry configuration (e.g. urllib3.util.retry.Retry). - :param cert_file: The path to a client certificate file, for mTLS. - :param key_file: The path to a client key file, for mTLS. - :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. - :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. - :param connection_pool_maxsize: Connection pool max size. Defaults to 100 for asyncio, cpu_count * 5 for sync. - :param proxy: Proxy URL. - :param proxy_headers: Proxy headers. - :param safe_chars_for_path_param: Safe characters for path parameter encoding. - :param client_side_validation: Enable client-side validation. Default True. - :param socket_options: Options to pass down to the underlying urllib3 socket. - :param datetime_format: Datetime format string for serialization. - :param date_format: Date format string for serialization. :Example: @@ -156,7 +141,7 @@ def __init__(self, host=None, signing_info=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, verify_ssl=True, + ssl_ca_cert=None, ) -> None: """Constructor """ @@ -223,7 +208,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = verify_ssl + self.verify_ssl = True """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -617,4 +602,4 @@ def host(self): def host(self, value): """Fix base path.""" self._base_path = value - self.server_index = None + self.server_index = None \ No newline at end of file