forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 6.0.x
This commit is contained in:
@@ -21,6 +21,7 @@ Use any API key
|
||||
|
||||
* Api Key Authentication (api_key):
|
||||
* Api Key Authentication (api_key_query):
|
||||
|
||||
```python
|
||||
import time
|
||||
import x_auth_id_alias
|
||||
@@ -82,6 +83,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | successful operation | - |
|
||||
@@ -99,6 +101,7 @@ Use both API keys
|
||||
|
||||
* Api Key Authentication (api_key):
|
||||
* Api Key Authentication (api_key_query):
|
||||
|
||||
```python
|
||||
import time
|
||||
import x_auth_id_alias
|
||||
@@ -160,6 +163,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | successful operation | - |
|
||||
@@ -176,6 +180,7 @@ Use API key in header
|
||||
### Example
|
||||
|
||||
* Api Key Authentication (api_key):
|
||||
|
||||
```python
|
||||
import time
|
||||
import x_auth_id_alias
|
||||
@@ -231,6 +236,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | successful operation | - |
|
||||
@@ -247,6 +253,7 @@ Use API key in query
|
||||
### Example
|
||||
|
||||
* Api Key Authentication (api_key_query):
|
||||
|
||||
```python
|
||||
import time
|
||||
import x_auth_id_alias
|
||||
@@ -302,6 +309,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | successful operation | - |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
@@ -55,4 +55,3 @@ git pull origin master
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
|
||||
|
||||
@@ -588,12 +588,12 @@ class ApiClient(object):
|
||||
else:
|
||||
return content_types[0]
|
||||
|
||||
def update_params_for_auth(self, headers, querys, auth_settings,
|
||||
def update_params_for_auth(self, headers, queries, auth_settings,
|
||||
resource_path, method, body):
|
||||
"""Updates header and query params based on authentication setting.
|
||||
|
||||
:param headers: Header parameters dict to be updated.
|
||||
:param querys: Query parameters tuple list to be updated.
|
||||
:param queries: Query parameters tuple list to be updated.
|
||||
:param auth_settings: Authentication setting identifiers list.
|
||||
:param resource_path: A string representation of the HTTP request resource path.
|
||||
:param method: A string representation of the HTTP request method.
|
||||
@@ -612,7 +612,7 @@ class ApiClient(object):
|
||||
if auth_setting['type'] != 'http-signature':
|
||||
headers[auth_setting['key']] = auth_setting['value']
|
||||
elif auth_setting['in'] == 'query':
|
||||
querys.append((auth_setting['key'], auth_setting['value']))
|
||||
queries.append((auth_setting['key'], auth_setting['value']))
|
||||
else:
|
||||
raise ApiValueError(
|
||||
'Authentication token must be in `query` or `header`'
|
||||
|
||||
@@ -73,7 +73,7 @@ class Configuration(object):
|
||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||
string values to replace variables in templated server configuration.
|
||||
The validation of enums is performed for variables with defined enum values before.
|
||||
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||
in PEM format
|
||||
|
||||
:Example:
|
||||
|
||||
@@ -446,7 +446,7 @@ class ModelSimple(OpenApiModel):
|
||||
)
|
||||
|
||||
def __contains__(self, name):
|
||||
"""used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`"""
|
||||
"""used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`"""
|
||||
if name in self.required_properties:
|
||||
return name in self.__dict__
|
||||
|
||||
@@ -501,7 +501,7 @@ class ModelNormal(OpenApiModel):
|
||||
)
|
||||
|
||||
def __contains__(self, name):
|
||||
"""used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`"""
|
||||
"""used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`"""
|
||||
if name in self.required_properties:
|
||||
return name in self.__dict__
|
||||
|
||||
@@ -648,7 +648,7 @@ class ModelComposed(OpenApiModel):
|
||||
return value
|
||||
|
||||
def __contains__(self, name):
|
||||
"""used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`"""
|
||||
"""used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`"""
|
||||
|
||||
if name in self.required_properties:
|
||||
return name in self.__dict__
|
||||
@@ -1479,6 +1479,9 @@ def is_valid_type(input_class_simple, valid_classes):
|
||||
Returns:
|
||||
bool
|
||||
"""
|
||||
if issubclass(input_class_simple, OpenApiModel) and \
|
||||
valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,):
|
||||
return True
|
||||
valid_type = input_class_simple in valid_classes
|
||||
if not valid_type and (
|
||||
issubclass(input_class_simple, OpenApiModel) or
|
||||
@@ -1747,7 +1750,10 @@ def get_allof_instances(self, model_args, constant_args):
|
||||
for allof_class in self._composed_schemas['allOf']:
|
||||
|
||||
try:
|
||||
allof_instance = allof_class(**model_args, **constant_args)
|
||||
if constant_args.get('_spec_property_naming'):
|
||||
allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
|
||||
else:
|
||||
allof_instance = allof_class(**model_args, **constant_args)
|
||||
composed_instances.append(allof_instance)
|
||||
except Exception as ex:
|
||||
raise ApiValueError(
|
||||
@@ -1809,10 +1815,16 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None):
|
||||
|
||||
try:
|
||||
if not single_value_input:
|
||||
oneof_instance = oneof_class(**model_kwargs, **constant_kwargs)
|
||||
if constant_kwargs.get('_spec_property_naming'):
|
||||
oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs)
|
||||
else:
|
||||
oneof_instance = oneof_class(**model_kwargs, **constant_kwargs)
|
||||
else:
|
||||
if issubclass(oneof_class, ModelSimple):
|
||||
oneof_instance = oneof_class(model_arg, **constant_kwargs)
|
||||
if constant_kwargs.get('_spec_property_naming'):
|
||||
oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs)
|
||||
else:
|
||||
oneof_instance = oneof_class(model_arg, **constant_kwargs)
|
||||
elif oneof_class in PRIMITIVE_TYPES:
|
||||
oneof_instance = validate_and_convert_types(
|
||||
model_arg,
|
||||
@@ -1867,7 +1879,10 @@ def get_anyof_instances(self, model_args, constant_args):
|
||||
continue
|
||||
|
||||
try:
|
||||
anyof_instance = anyof_class(**model_args, **constant_args)
|
||||
if constant_args.get('_spec_property_naming'):
|
||||
anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args)
|
||||
else:
|
||||
anyof_instance = anyof_class(**model_args, **constant_args)
|
||||
anyof_instances.append(anyof_instance)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user