Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path

NAME = "shotstack-sdk"
VERSION = "0.2.7"
VERSION = "0.2.8"
# To install the library, run the following
#
# python setup.py install
Expand Down
2 changes: 1 addition & 1 deletion shotstack_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""


__version__ = "0.2.7"
__version__ = "0.2.8"

# import ApiClient
from shotstack_sdk.api_client import ApiClient
Expand Down
2 changes: 1 addition & 1 deletion shotstack_sdk/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/0.2.7/python'
self.user_agent = 'OpenAPI-Generator/0.2.8/python'

def __enter__(self):
return self
Expand Down
2 changes: 1 addition & 1 deletion shotstack_sdk/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v1\n"\
"SDK Package Version: 0.2.7".\
"SDK Package Version: 0.2.8".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
26 changes: 26 additions & 0 deletions shotstack_sdk/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ def __new__(cls, *args, **kwargs):
# The discriminator name is obtained from the discriminator meta-data
# and the discriminator value is obtained from the input data.
discr_propertyname_py = list(cls.discriminator.keys())[0]

# DO NOT DELETE #
if not discr_propertyname_py in cls.attribute_map:
return None

discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
if discr_propertyname_js in kwargs:
discr_value = kwargs[discr_propertyname_js]
Expand Down Expand Up @@ -373,6 +378,11 @@ def _new_from_openapi_data(cls, *args, **kwargs):
# The discriminator name is obtained from the discriminator meta-data
# and the discriminator value is obtained from the input data.
discr_propertyname_py = list(cls.discriminator.keys())[0]

# DO NOT DELETE #
if not discr_propertyname_py in cls.attribute_map:
return None

discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
if discr_propertyname_js in kwargs:
discr_value = kwargs[discr_propertyname_js]
Expand Down Expand Up @@ -1528,6 +1538,17 @@ def is_valid_type(input_class_simple, valid_classes):
return True
return valid_type

# DO NOT DELETE
# Custom code checks for placeholders to bypass type checking
def is_placeholder(input_value):
if isinstance(input_value, str):
pattern = r'\{\{\s*.*\s*\}\}'
match = re.search(pattern, input_value)

if match:
return True

return False

def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
spec_property_naming, _check_type, configuration=None):
Expand Down Expand Up @@ -1559,6 +1580,11 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
Raises:
ApiTypeError
"""

# DO NO DELETE - runs placeholder check
if is_placeholder(input_value):
return input_value

results = get_required_type_classes(required_types_mixed, spec_property_naming)
valid_classes, child_req_types_by_current_type = results

Expand Down