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
25 changes: 25 additions & 0 deletions patches/model_utils.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/shotstack_sdk/model_utils.py b/model_utils.py
index bb97211..eb381f6 100644
--- a/shotstack_sdk/model_utils.py
+++ b/model_utils.py
@@ -250,6 +250,7 @@ class OpenApiModel(object):
# Get the name and value of the discriminator property.
# 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]
discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
if discr_propertyname_js in kwargs:
@@ -372,7 +373,12 @@ class OpenApiModel(object):
# 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]
+ 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]
elif discr_propertyname_py in kwargs:
13 changes: 13 additions & 0 deletions patches/render_response_data.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/shotstack_sdk/model/render_response_data.py b/render_response_data.py
index 49d7a25..8696157 100644
--- a/shotstack_sdk/model/render_response_data.py
+++ b/render_response_data.py
@@ -224,7 +224,7 @@ class RenderResponseData(ModelNormal):
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
- self.additional_properties_type is None:
+ self.additional_properties_type is None or var_value is None:
# discard variable.
continue
setattr(self, var_name, var_value)