Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,23 @@ class Configuration:
string values to replace variables in templated server configuration.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Constructor no longer accepts documented configuration parameters and hard-codes their defaults, so callers cannot pass options like retries/cert_file/proxy and the docstring is misleading.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache, line 241:

<comment>Constructor no longer accepts documented configuration parameters and hard-codes their defaults, so callers cannot pass options like retries/cert_file/proxy and the docstring is misleading.</comment>

<file context>
@@ -244,28 +238,28 @@ conf = {{{packageName}}}.Configuration(
         """Set this to customize the certificate file to verify the peer.
         """
-        self.cert_file = cert_file
+        self.cert_file = None
         """client certificate file
         """
</file context>
Fix with Cubic

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:
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -215,36 +236,36 @@ 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.
"""
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
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Asyncio constructor treats None as “use default 100,” so callers cannot request the documented None = no‑limit behavior via the constructor.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/python-pydantic-v1/configuration.mustache, line 262:

<comment>Asyncio constructor treats `None` as “use default 100,” so callers cannot request the documented `None` = no‑limit behavior via the constructor.</comment>

<file context>
@@ -215,36 +236,36 @@ conf = {{{packageName}}}.Configuration(
 
         {{#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.
</file context>
Fix with Cubic

"""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
Expand All @@ -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
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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:
Expand Down Expand Up @@ -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,
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
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:
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,25 @@ 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.
:param ca_cert_data: verify the peer using concatenated CA certificate data
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:

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -292,46 +315,46 @@ 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
requests to the same host, which is often the case here.
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
"""

Expand Down
Loading
Loading