Skip to content

Commit

Permalink
Merge pull request #447 from chantera/add-model_template_dir-option
Browse files Browse the repository at this point in the history
Add `--model-template-dir` option
  • Loading branch information
koxudaxi authored Dec 14, 2024
2 parents 6238ff8 + e48f987 commit 5ef88e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fastapi_code_generator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def main(
output_dir: Path = typer.Option(..., "--output", "-o"),
model_file: str = typer.Option(None, "--model-file", "-m"),
template_dir: Optional[Path] = typer.Option(None, "--template-dir", "-t"),
model_template_dir: Optional[Path] = typer.Option(None, "--model-template-dir"),
enum_field_as_literal: Optional[LiteralType] = typer.Option(
None, "--enum-field-as-literal"
),
Expand Down Expand Up @@ -82,6 +83,7 @@ def main(
encoding,
output_dir,
template_dir,
model_template_dir,
model_path,
enum_field_as_literal=enum_field_as_literal or None,
custom_visitors=custom_visitors,
Expand Down Expand Up @@ -109,6 +111,7 @@ def generate_code(
encoding: str,
output_dir: Path,
template_dir: Optional[Path],
model_template_dir: Optional[Path] = None,
model_path: Optional[Path] = None,
enum_field_as_literal: Optional[LiteralType] = None,
custom_visitors: Optional[List[Path]] = None,
Expand Down Expand Up @@ -140,6 +143,7 @@ def generate_code(
data_model_field_type=data_model_types.field_model,
data_type_manager_type=data_model_types.data_type_manager,
dump_resolve_reference_action=data_model_types.dump_resolve_reference_action,
custom_template_dir=model_template_dir,
target_python_version=python_version,
)

Expand Down

0 comments on commit 5ef88e7

Please sign in to comment.