Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow generation of subdirs when using '--template-dir' #350

Open
ThisIsANiceName opened this issue May 17, 2023 · 0 comments
Open

Allow generation of subdirs when using '--template-dir' #350

ThisIsANiceName opened this issue May 17, 2023 · 0 comments

Comments

@ThisIsANiceName
Copy link

ThisIsANiceName commented May 17, 2023

Hi.

I'd love to be able to generate sub directories when using the --template-dir option. Currently this is not possible as in fastapi_code_generator/main for target in template_dir.rglob("*"): is used instead of for target in template_dir.rglob("*.jinja2"): and parsing a directory path to the code gen throws an error.

Furthermore it would be cool to automatically generate subpaths if they do not exist.

Example:

templates:
  generated:
    router.jinja2
  main.jinja2

should result in
main.py, generated/router.py

This would help me, structuring the generated code further.

I'd like to make a pull request for this, but would love some input first :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant