Experiment with alternative approaches to inject dependencies in a Flask application.
Made good progress trying to inject depedencies, as well as validating requests with Pydantic. Currently facing problems with dependency overriding. See app_3_fastdepends.py.
Problem: Flask-Pydantic tries to validate the type of injected dependecy. ...
Testing flask_openapi3 with flask_injector.
injector: call_with_injection() L1050: return callable(*full_args, **dependencies)
scaffold.APIScaffold.create_view_func.view_func() L104 _validate_request(), the injected dependency is considered a path_kwargs, which gets validated and the dependency is stripped from kwargs 🫠
- Working on jstasiak's suggestion in: python-injector/flask_injector#83, which involves replacing
get_type_hints()withinjector.get_bindings()to detect if we actually have anything to inject. - I'm ready to submmit a PR for this issue, just need to think about the devX of setting this behavior, as well as the tests.
- Raised a PR for this issue: python-injector/flask_injector#85