From 1fe2eb6b7a82fe6fe3b4736f4f36bcd6babd0480 Mon Sep 17 00:00:00 2001 From: tuanchien Date: Sat, 19 Mar 2022 17:34:06 +1300 Subject: [PATCH] Fix undefined object in Python model __copy__ template (#11792) * Fix new_cls in methods_shared copy template * Add generated files --- .../resources/python/model_templates/methods_shared.mustache | 2 +- samples/client/petstore/python/petstore_api/model_utils.py | 2 +- .../petstore_api/model_utils.py | 2 +- .../x-auth-id-alias/python/x_auth_id_alias/model_utils.py | 2 +- .../dynamic-servers/python/dynamic_servers/model_utils.py | 2 +- .../openapi3/client/petstore/python/petstore_api/model_utils.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache index eddad2533af..5ffef97f6b6 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_templates/methods_shared.mustache @@ -19,7 +19,7 @@ if self.get("_spec_property_naming", False): return cls._new_from_openapi_data(**self.__dict__) else: - return new_cls.__new__(cls, **self.__dict__) + return cls.__new__(cls, **self.__dict__) def __deepcopy__(self, memo): cls = self.__class__ diff --git a/samples/client/petstore/python/petstore_api/model_utils.py b/samples/client/petstore/python/petstore_api/model_utils.py index 0bfd4ed181c..1b16e528b13 100644 --- a/samples/client/petstore/python/petstore_api/model_utils.py +++ b/samples/client/petstore/python/petstore_api/model_utils.py @@ -193,7 +193,7 @@ class OpenApiModel(object): if self.get("_spec_property_naming", False): return cls._new_from_openapi_data(**self.__dict__) else: - return new_cls.__new__(cls, **self.__dict__) + return cls.__new__(cls, **self.__dict__) def __deepcopy__(self, memo): cls = self.__class__ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py index 0bfd4ed181c..1b16e528b13 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model_utils.py @@ -193,7 +193,7 @@ class OpenApiModel(object): if self.get("_spec_property_naming", False): return cls._new_from_openapi_data(**self.__dict__) else: - return new_cls.__new__(cls, **self.__dict__) + return cls.__new__(cls, **self.__dict__) def __deepcopy__(self, memo): cls = self.__class__ diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py index e070ab26e5c..971302f1999 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py @@ -193,7 +193,7 @@ class OpenApiModel(object): if self.get("_spec_property_naming", False): return cls._new_from_openapi_data(**self.__dict__) else: - return new_cls.__new__(cls, **self.__dict__) + return cls.__new__(cls, **self.__dict__) def __deepcopy__(self, memo): cls = self.__class__ diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py index f258f1e6c47..94e8c1fbe2a 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py @@ -193,7 +193,7 @@ class OpenApiModel(object): if self.get("_spec_property_naming", False): return cls._new_from_openapi_data(**self.__dict__) else: - return new_cls.__new__(cls, **self.__dict__) + return cls.__new__(cls, **self.__dict__) def __deepcopy__(self, memo): cls = self.__class__ diff --git a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py index 0bfd4ed181c..1b16e528b13 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model_utils.py @@ -193,7 +193,7 @@ class OpenApiModel(object): if self.get("_spec_property_naming", False): return cls._new_from_openapi_data(**self.__dict__) else: - return new_cls.__new__(cls, **self.__dict__) + return cls.__new__(cls, **self.__dict__) def __deepcopy__(self, memo): cls = self.__class__