Skip to content

How to configure so that only parameters marked with Inject[SomeType] are injected? #83

@jonathanmach

Description

@jonathanmach

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:

@webhooks_api.route("/my_webhook", methods=["POST"])
@pydantic_validate()
def my_webhook(body: WebhookContract):
    ...

In the code above, flask_injector seems to be taking priority and raising:

E  injector.UnsatisfiedRequirement: core.domains.rest.webhooks has an unsatisfied requirement on WebhookContract

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions