diff --git a/example/client/api_client.py b/example/client/api_client.py index fe24faf..861b374 100644 --- a/example/client/api_client.py +++ b/example/client/api_client.py @@ -78,7 +78,7 @@ def request_sync(self, *, type_: Any, **kwargs: Any) -> Any: # noqa F811 async def send(self, request: Request, type_: Type[T]) -> T: response = await self.middleware(request, self.send_inner) - if response.status_code in [200, 201]: + if response.status_code in [200, 201, 202]: try: return parse_obj_as(type_, response.json()) except ValidationError as e: diff --git a/openapi-python-templates/api_client.mustache b/openapi-python-templates/api_client.mustache index bcd43eb..7b11424 100644 --- a/openapi-python-templates/api_client.mustache +++ b/openapi-python-templates/api_client.mustache @@ -72,7 +72,7 @@ class ApiClient: async def send(self, request: Request, type_: Type[T]) -> T: response = await self.middleware(request, self.send_inner) - if response.status_code in [200, 201]: + if response.status_code in [200, 201, 202]: try: return parse_obj_as(type_, response.json()) except ValidationError as e: