Skip to content

Commit c85adc2

Browse files
committed
fix: import Optional when properties are nullable or not required
1 parent 2108907 commit c85adc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openapi_python_client/parser/properties.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_imports(self, *, prefix: str) -> Set[str]:
6363
Args:
6464
prefix: A prefix to put before any relative (local) module names.
6565
"""
66-
if not self.required:
66+
if self.nullable or not self.required:
6767
return {"from typing import Optional"}
6868
return set()
6969

0 commit comments

Comments
 (0)