mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 16:12:49 +00:00
[python-nextgen] fix bug fix and enhancement (#14308)
* add access token * remove disabled_client_side_validations * remove discard_unknown_keys * update samples * fix array/map default value * add krjakbrjak to python tc
This commit is contained in:
@@ -43,30 +43,7 @@ class Configuration(object):
|
||||
The dict value is an API key prefix when generating the auth data.
|
||||
:param username: Username for HTTP basic authentication.
|
||||
:param password: Password for HTTP basic authentication.
|
||||
:param discard_unknown_keys: Boolean value indicating whether to discard
|
||||
unknown properties. A server may send a response that includes additional
|
||||
properties that are not known by the client in the following scenarios:
|
||||
1. The OpenAPI document is incomplete, i.e. it does not match the server
|
||||
implementation.
|
||||
2. The client was generated using an older version of the OpenAPI document
|
||||
and the server has been upgraded since then.
|
||||
If a schema in the OpenAPI document defines the additionalProperties attribute,
|
||||
then all undeclared properties received by the server are injected into the
|
||||
additional properties map. In that case, there are undeclared properties, and
|
||||
nothing to discard.
|
||||
:param disabled_client_side_validations (string): Comma-separated list of
|
||||
JSON schema validation keywords to disable JSON schema structural validation
|
||||
rules. The following keywords may be specified: multipleOf, maximum,
|
||||
exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
|
||||
maxItems, minItems.
|
||||
By default, the validation is performed for data generated locally by the client
|
||||
and data received from the server, independent of any validation performed by
|
||||
the server side. If the input data does not satisfy the JSON schema validation
|
||||
rules specified in the OpenAPI document, an exception is raised.
|
||||
If disabled_client_side_validations is set, structural validation is
|
||||
disabled. This can be useful to troubleshoot data validation problem, such as
|
||||
when the OpenAPI document validation rules do not match the actual API data
|
||||
received by the server.
|
||||
:param access_token: Access token.
|
||||
:param signing_info: Configuration parameters for the HTTP signature security scheme.
|
||||
Must be an instance of petstore_api.signing.HttpSigningConfiguration
|
||||
:param server_index: Index to servers configuration.
|
||||
@@ -163,8 +140,7 @@ conf = petstore_api.Configuration(
|
||||
def __init__(self, host=None,
|
||||
api_key=None, api_key_prefix=None,
|
||||
username=None, password=None,
|
||||
discard_unknown_keys=False,
|
||||
disabled_client_side_validations="",
|
||||
access_token=None,
|
||||
signing_info=None,
|
||||
server_index=None, server_variables=None,
|
||||
server_operation_index=None, server_operation_variables=None,
|
||||
@@ -206,8 +182,9 @@ conf = petstore_api.Configuration(
|
||||
self.password = password
|
||||
"""Password for HTTP basic authentication
|
||||
"""
|
||||
self.discard_unknown_keys = discard_unknown_keys
|
||||
self.disabled_client_side_validations = disabled_client_side_validations
|
||||
self.access_token = access_token
|
||||
"""Access token
|
||||
"""
|
||||
if signing_info is not None:
|
||||
signing_info.host = host
|
||||
self.signing_info = signing_info
|
||||
@@ -295,13 +272,6 @@ conf = petstore_api.Configuration(
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
object.__setattr__(self, name, value)
|
||||
if name == 'disabled_client_side_validations':
|
||||
s = set(filter(None, value.split(',')))
|
||||
for v in s:
|
||||
if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
|
||||
raise ApiValueError(
|
||||
"Invalid keyword: '{0}''".format(v))
|
||||
self._disabled_client_side_validations = s
|
||||
if name == "signing_info" and value is not None:
|
||||
# Ensure the host parameter from signing info is the same as
|
||||
# Configuration.host.
|
||||
|
||||
Reference in New Issue
Block a user