diff --git a/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py b/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py index 5c2113edd1c..b9fe267ca93 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/model/foo_object.py @@ -149,14 +149,18 @@ class FooObject(ModelNormal): self = super(OpenApiModel, cls).__new__(cls) if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) self._data_store = {} self._check_type = _check_type @@ -230,14 +234,18 @@ class FooObject(ModelNormal): _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) self._data_store = {} self._check_type = _check_type