Skip to content

Commit 6b734c6

Browse files
committed
openapi_schema_pydantic / correct typing
1 parent b552181 commit 6b734c6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

openapi_python_client/schema/openapi_schema_pydantic/callback.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
from typing import Dict
1+
from typing import TYPE_CHECKING, Dict
22

3-
Callback = Dict[str, "PathItem"] # type: ignore [name-defined]
3+
if TYPE_CHECKING:
4+
from .path_item import PathItem
5+
6+
Callback = Dict[str, "PathItem"]
47
"""
58
A map of possible out-of band callbacks related to the parent operation.
69
Each value in the map is a [Path Item Object](#pathItemObject)

openapi_python_client/schema/openapi_schema_pydantic/encoding.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
from typing import Dict, Optional, Union
1+
from typing import TYPE_CHECKING, Dict, Optional, Union
22

33
from pydantic import BaseModel, Extra
44

55
from .reference import Reference
66

7+
if TYPE_CHECKING:
8+
from .header import Header
9+
710

811
class Encoding(BaseModel):
912
"""A single encoding definition applied to a single schema property."""
@@ -22,7 +25,7 @@ class Encoding(BaseModel):
2225
or a comma-separated list of the two types.
2326
"""
2427

25-
headers: Optional[Dict[str, Union["Header", Reference]]] = None # type: ignore [name-defined]
28+
headers: Optional[Dict[str, Union["Header", Reference]]] = None
2629
"""
2730
A map allowing additional information to be provided as headers, for example `Content-Disposition`.
2831

0 commit comments

Comments
 (0)