From d030ed91e5c47f22261d7e3217b0837bba1a0da6 Mon Sep 17 00:00:00 2001 From: Nick Lloyd Date: Mon, 22 Jul 2024 14:03:57 +0200 Subject: [PATCH] Automated update by SDK Generator (#78) --- src/apideck/model_utils.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/apideck/model_utils.py b/src/apideck/model_utils.py index e1e5f1a9f..250e73fb1 100644 --- a/src/apideck/model_utils.py +++ b/src/apideck/model_utils.py @@ -121,6 +121,7 @@ class OpenApiModel(object): def set_attribute(self, name, value): # this is only used to set properties on self + # something here path_to_item = [] if self._path_to_item: @@ -130,11 +131,14 @@ def set_attribute(self, name, value): if name in self.openapi_types: required_types_mixed = self.openapi_types[name] elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) + # This is a custom implementation to handle the case where the attribute is not defined in the model + return + + # raise ApiAttributeError( + # "{0} has no attribute '{1}'".format( + # type(self).__name__, name), + # path_to_item + # ) elif self.additional_properties_type is not None: required_types_mixed = self.additional_properties_type @@ -171,6 +175,7 @@ def set_attribute(self, name, value): ) self.__dict__['_data_store'][name] = value + def __repr__(self): """For `print` and `pprint`""" return self.to_str()