Skip to content

Commit cc62b44

Browse files
authored
Merge branch 'master' into patch-1
2 parents e0f114a + 89f0ce4 commit cc62b44

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fastapi_code_generator/__main__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def generate_code(
110110
output_dir: Path,
111111
template_dir: Optional[Path],
112112
model_path: Optional[Path] = None,
113-
enum_field_as_literal: Optional[str] = None,
114-
custom_visitors: Optional[List[Path]] = [],
113+
enum_field_as_literal: Optional[LiteralType] = None,
114+
custom_visitors: Optional[List[Path]] = None,
115115
disable_timestamp: bool = False,
116116
generate_routers: Optional[bool] = None,
117117
specify_tags: Optional[str] = None,
@@ -128,7 +128,8 @@ def generate_code(
128128
template_dir = (
129129
BUILTIN_MODULAR_TEMPLATE_DIR if generate_routers else BUILTIN_TEMPLATE_DIR
130130
)
131-
131+
if not custom_visitors:
132+
custom_visitors = []
132133
data_model_types = get_data_model_types(output_model_type, python_version)
133134

134135
parser = OpenAPIParser(

0 commit comments

Comments
 (0)