-
Notifications
You must be signed in to change notification settings - Fork 41
How to configure so that only parameters marked with Inject[SomeType]
are injected?
#83
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
Comments
Inject[SomeType]
are injected?Inject[SomeType]
are injected?
Hey, that's a good question – that's not really supported at the moment and I think we need to make it configurable |
Hey @jstasiak, I hope all is well. |
Hey @jonathanmach, I imagine it'll be roughly like this: In this piece of code flask_injector/flask_injector/__init__.py Line 65 in 004b9b5
|
Hey there, any updates on this issue ? I came across the same problem and would be happy to help, if @jonathanmach hasn't been able to get to work on it yet. |
Hey @raul-macedo-freire, all the updates we have on this are above. Can you clarify what do you mean by "it would require inject decorator to be included for endpoint methods"? An example would be great. |
Hey there, I'm embarrassed by how long I took to come back in here hehe. But I've tried to reproduce what I was initially trying to achieve and noticed that I was actually trying to keep both behaviors (Flask-Pydantic and Flask-Injector). I tried to find a way to make Flask-Injector wrap the route functions with binded classes and keep Flask-Pydantic validated models in the wraped functions. To explain what I meant on my first comment, @jstasiak, with the proposed solution I could not achieve what I initially intended, since the binded functions would no longer work, requiring the Without any changes in Flask-Injector, I tried the following
If I were to implement the proposed changes, I believe @jonathanmach has achieved more progress under the proposed solution. |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I have been diving deep into the lib and can't stress enough how much of a great project this is!
I'm using flask_injector and Flask-Pydantic, however, they seem to be conflicting with each other.
(EDIT: I don't think this is Pydantic-specific)
ie:
In the code above, flask_injector seems to be taking priority and raising:
Any tips on how to configure things so that only parameters marked with
Inject[SomeType]
are injected?See: https://injector.readthedocs.io/en/latest/api.html#injector.Inject
The text was updated successfully, but these errors were encountered: