Skip to content

Commit 0a0671b

Browse files
committed
fix: import cast for required const properties, since it's used in the template
Resolves openapi-generators#1150
1 parent 4fbafa5 commit 0a0671b

File tree

1 file changed

+1
-1
lines changed
  • openapi_python_client/parser/properties

1 file changed

+1
-1
lines changed

openapi_python_client/parser/properties/const.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def get_imports(self, *, prefix: str) -> set[str]:
111111
back to the root of the generated client.
112112
"""
113113
if self.required:
114-
return {"from typing import Literal"}
114+
return {"from typing import Literal, cast"}
115115
return {
116116
"from typing import Literal, Union, cast",
117117
f"from {prefix}types import UNSET, Unset",

0 commit comments

Comments
 (0)