-
Notifications
You must be signed in to change notification settings - Fork 59
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
Using flask-pydantic with Python Dependency Injection Framework #49
Comments
So it's saying |
İt is because of PostService class is not Pydantic model. PostService class is just simple object with crud |
I recently started getting this erorr from flask_pydantic import validate
@blueprint.route("/clone", subdomain="<subdomain>", methods=["POST"])
@inject_client()
@validate()
def clone_client_endpoint(
body: ClientCloneReq, # A Pydantic model
client: Client, # not a Pydantic model, comes from @inject_client()
**kwargs
): |
I think this issue not only about Python Dependency Injection Framework. This error appears when we use not Pydantic models in annotations |
Yeah, just weird that this is broken now. Definitely worked before we upgraded from 0.4 to 0.9. |
I had the same issue and did a little investigation. The problem seems to be with validate_path_params method in validate decorator. That was introduced in 0.7.0 version, so it tell why David didn't have the issue with version 0.4.0. The issue is, it takes path parameters from the method arguments instead of route as it should. |
Encountering the same issue. We use Wireup for DI and flask-pydantic as well. Sadly can't use both on the same view as flask-pydantic will throw. |
Hi! I am using this module with Python Dependency Injection Framework and when i try to use Provider in kwargs of the view i am getting:
RuntimeError: no validator found for <class '...'>, see arbitrary_types_allowed in Config
Reason of this error is the fact that @Validate decorator ignores only kwargs named as "query", "body", "return".
It would be better if @Validate decorator ignored kwargs which default is Provide instance
Sample code:
The text was updated successfully, but these errors were encountered: