-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Feature/generate routers #344
Conversation
TODO: fix .model to ..model in imports.py visitor
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #344 +/- ##
==========================================
+ Coverage 91.09% 91.90% +0.81%
==========================================
Files 5 6 +1
Lines 348 383 +35
==========================================
+ Hits 317 352 +35
Misses 31 31
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
fastapi_code_generator/__main__.py
Outdated
# if generate_routers: | ||
# template_dir = BUILTIN_MODULAR_TEMPLATE_DIR | ||
# Path(output_dir / "routers").mkdir(parents=True, exist_ok=True) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the commented lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
I removed it.
@v1kAn0v |
Hello koxudaxi,
Let me introduce myself first.
I am Data Engineer working for an Elbit Systems (Israeli Company)
We widely use your fastapi-code-generator in one of our application API's.
I faced necessarily to split large API main.py into routers grouped by Tags corresponding to same model.py, using shared dependencies.py and routed to single main.py (as it recommended by tiangolo FastAPI APIRouter() approach here
I would like to contribute code I have developed so your code generator will support this feature with ease.
I believe it will help many developers across the globe enhance capabilities of their applications and allow to maintain it with ease when large application could be split apart based on tags defined in swagger .yaml. No need to regenerate entire main, only endpoints with tags you only intend to change. I think it could be great contribution to your code and to entire community.
I'll appreciate you will add me as a contributor to your project.
The code passed tests, format and doesn't affect your overall coverage. For more details please see README.md with explanations of usage.
Great day and thank You