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

How could someone use rodi in web frameworks other than BlackSheep #51

Open
aeb-dev opened this issue Jan 7, 2024 · 3 comments
Open

Comments

@aeb-dev
Copy link

aeb-dev commented Jan 7, 2024

I am trying to integrate rodi with FastAPI but I am not sure how should I approach to the problem.

Is there any example? Flask or any other web framework example would also help

@lucas-labs
Copy link
Contributor

@aeb-dev
I'm creating a library using Rodi and FastAPI. Although it might be overkill for what you're asking, you can see how I implemented and combined them here if you have the time to go through the code haha:

https://github.com/lucas-labs/pest/blob/master/pest/core/module.py

@aeb-dev
Copy link
Author

aeb-dev commented Feb 12, 2024

Thank you @lucas-labs. We actually inspired from your project to achieve what we want. Thanks for the idea!

@StummeJ
Copy link
Contributor

StummeJ commented Feb 28, 2024

We integrated Rodi into FastAPI via a custom middleware, and to Strawberry via a SchemaExtension. To not interfere with either framework we use wrappers to remove the autowired parameters from what the frameworks see. Strawberry specifically isn't friendly to this process.

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

3 participants