From 69e4d3b8fdb6172c31ca1439afc489fb23510e7b Mon Sep 17 00:00:00 2001 From: mhoeger Date: Fri, 1 Oct 2021 13:47:38 -0700 Subject: [PATCH] add 202 as valid response status code --- example/client/api_client.py | 2 +- openapi-python-templates/api_client.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: