File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,11 @@ def generate_code(
117117 if not output_dir .exists ():
118118 output_dir .mkdir (parents = True )
119119 if generate_routers :
120- template_dir = BUILTIN_MODULAR_TEMPLATE_DIR
121120 Path (output_dir / "routers" ).mkdir (parents = True , exist_ok = True )
122121 if not template_dir :
123- template_dir = BUILTIN_TEMPLATE_DIR
122+ template_dir = (
123+ BUILTIN_MODULAR_TEMPLATE_DIR if generate_routers else BUILTIN_TEMPLATE_DIR
124+ )
124125 if enum_field_as_literal :
125126 parser = OpenAPIParser (input_text , enum_field_as_literal = enum_field_as_literal )
126127 else :
@@ -195,7 +196,7 @@ def generate_code(
195196 set (tag .strip () for tag in str (specify_tags ).split ("," ))
196197 )
197198
198- for target in BUILTIN_MODULAR_TEMPLATE_DIR .rglob ("routers.*" ):
199+ for target in template_dir .rglob ("routers.*" ):
199200 relative_path = target .relative_to (template_dir )
200201 for router , tag in zip (routers , sorted_tags ):
201202 if (
You can’t perform that action at this time.
0 commit comments