From f43bed1bca6b662c34167139a0cc95bb787a41d5 Mon Sep 17 00:00:00 2001 From: Rushil Patel Date: Tue, 8 Apr 2025 12:10:28 -0700 Subject: [PATCH 1/3] fix: undefined field type --- src/codegen/agents/client/openapi_client/api_response.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/codegen/agents/client/openapi_client/api_response.py b/src/codegen/agents/client/openapi_client/api_response.py index e8af61447..1c4da121c 100644 --- a/src/codegen/agents/client/openapi_client/api_response.py +++ b/src/codegen/agents/client/openapi_client/api_response.py @@ -2,12 +2,10 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Generic, TypeVar +from typing import Generic, TypeVar from pydantic import BaseModel, Field, StrictBytes, StrictInt - -if TYPE_CHECKING: - from collections.abc import Mapping +from collections.abc import Mapping T = TypeVar("T") From e07fb55f4fbc74f620d51cefd29f7636c316b072 Mon Sep 17 00:00:00 2001 From: rushilpatel0 <171610820+rushilpatel0@users.noreply.github.com> Date: Tue, 8 Apr 2025 19:13:22 +0000 Subject: [PATCH 2/3] Automated pre-commit update --- src/codegen/agents/client/openapi_client/api_response.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/codegen/agents/client/openapi_client/api_response.py b/src/codegen/agents/client/openapi_client/api_response.py index 1c4da121c..e8af61447 100644 --- a/src/codegen/agents/client/openapi_client/api_response.py +++ b/src/codegen/agents/client/openapi_client/api_response.py @@ -2,10 +2,12 @@ from __future__ import annotations -from typing import Generic, TypeVar +from typing import TYPE_CHECKING, Generic, TypeVar from pydantic import BaseModel, Field, StrictBytes, StrictInt -from collections.abc import Mapping + +if TYPE_CHECKING: + from collections.abc import Mapping T = TypeVar("T") From 46e1537136c07596a5a1856ff0f54e7468978a00 Mon Sep 17 00:00:00 2001 From: Rushil Patel Date: Tue, 8 Apr 2025 12:29:07 -0700 Subject: [PATCH 3/3] fix: use dict instead of mapping type --- src/codegen/agents/client/openapi_client/api_response.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/codegen/agents/client/openapi_client/api_response.py b/src/codegen/agents/client/openapi_client/api_response.py index e8af61447..3842a95da 100644 --- a/src/codegen/agents/client/openapi_client/api_response.py +++ b/src/codegen/agents/client/openapi_client/api_response.py @@ -2,13 +2,10 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Generic, TypeVar +from typing import Generic, TypeVar from pydantic import BaseModel, Field, StrictBytes, StrictInt -if TYPE_CHECKING: - from collections.abc import Mapping - T = TypeVar("T") @@ -16,7 +13,7 @@ class ApiResponse(BaseModel, Generic[T]): """API response object""" status_code: StrictInt = Field(description="HTTP status code") - headers: Mapping[str, str] | None = Field(None, description="HTTP headers") + headers: dict[str, str] | None = Field(None, description="HTTP headers") data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")