Merge remote-tracking branch 'origin/master' into 6.0.x

This commit is contained in:
William Cheng
2022-01-02 15:41:37 +08:00
2007 changed files with 39758 additions and 48375 deletions

View File

@@ -101,7 +101,7 @@ ext {
swagger_annotations_version = "1.6.3"
jackson_version = "2.13.0"
jackson_databind_version = "2.13.0"
jackson_databind_nullable_version = "0.2.1"
jackson_databind_nullable_version = "0.2.2"
jakarta_annotation_version = "1.3.5"
jersey_version = "2.35"
junit_version = "4.13.2"

View File

@@ -20,7 +20,7 @@ lazy val root = (project in file(".")).
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile",
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile",
"com.brsanthu" % "migbase64" % "2.2",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"junit" % "junit" % "4.13.2" % "test",

View File

@@ -342,7 +342,7 @@
<jersey-version>2.35</jersey-version>
<jackson-version>2.13.0</jackson-version>
<jackson-databind-version>2.13.0</jackson-databind-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
<threetenbp-version>2.9.10</threetenbp-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>4.13.2</junit-version>

View File

@@ -243,6 +243,9 @@ class UsageApi(object):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
@@ -271,6 +274,8 @@ class UsageApi(object):
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
return self.any_key_endpoint.call_with_http_info(**kwargs)
@@ -304,6 +309,9 @@ class UsageApi(object):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
@@ -332,6 +340,8 @@ class UsageApi(object):
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
return self.both_keys_endpoint.call_with_http_info(**kwargs)
@@ -365,6 +375,9 @@ class UsageApi(object):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
@@ -393,6 +406,8 @@ class UsageApi(object):
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
return self.key_in_header_endpoint.call_with_http_info(**kwargs)
@@ -426,6 +441,9 @@ class UsageApi(object):
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
@@ -454,6 +472,8 @@ class UsageApi(object):
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
return self.key_in_query_endpoint.call_with_http_info(**kwargs)

View File

@@ -131,7 +131,8 @@ class ApiClient(object):
_preload_content: bool = True,
_request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
_host: typing.Optional[str] = None,
_check_type: typing.Optional[bool] = None
_check_type: typing.Optional[bool] = None,
_content_type: typing.Optional[str] = None
):
config = self.configuration
@@ -572,10 +573,12 @@ class ApiClient(object):
else:
return ', '.join(accepts)
def select_header_content_type(self, content_types):
def select_header_content_type(self, content_types, method=None, body=None):
"""Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
:param method: http method (e.g. POST, PATCH).
:param body: http body to send.
:return: Content-Type (e.g. application/json).
"""
if not content_types:
@@ -583,6 +586,11 @@ class ApiClient(object):
content_types = [x.lower() for x in content_types]
if (method == 'PATCH' and
'application/json-patch+json' in content_types and
isinstance(body, list)):
return 'application/json-patch+json'
if 'application/json' in content_types or '*/*' in content_types:
return 'application/json'
else:
@@ -664,7 +672,8 @@ class Endpoint(object):
'_request_timeout',
'_return_http_data_only',
'_check_input_type',
'_check_return_type'
'_check_return_type',
'_content_type'
])
self.params_map['nullable'].extend(['_request_timeout'])
self.validations = root_map['validations']
@@ -677,7 +686,8 @@ class Endpoint(object):
'_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]),
'_return_http_data_only': (bool,),
'_check_input_type': (bool,),
'_check_return_type': (bool,)
'_check_return_type': (bool,),
'_content_type': (none_type, str)
}
self.openapi_types.update(extra_types)
self.attribute_map = root_map['attribute_map']
@@ -824,12 +834,16 @@ class Endpoint(object):
params['header']['Accept'] = self.api_client.select_header_accept(
accept_headers_list)
content_type_headers_list = self.headers_map['content_type']
if content_type_headers_list:
if params['body'] != "":
header_list = self.api_client.select_header_content_type(
content_type_headers_list)
params['header']['Content-Type'] = header_list
if kwargs.get('_content_type'):
params['header']['Content-Type'] = kwargs['_content_type']
else:
content_type_headers_list = self.headers_map['content_type']
if content_type_headers_list:
if params['body'] != "":
header_list = self.api_client.select_header_content_type(
content_type_headers_list, self.settings['http_method'],
params['body'])
params['header']['Content-Type'] = header_list
return self.api_client.call_api(
self.settings['endpoint_path'], self.settings['http_method'],