Skip to content

Prevent FastAPI from digging into real dependencies attributes detecting them as request data.

License

Notifications You must be signed in to change notification settings

SN4KEBYTE/fastapi-depends-stub

Repository files navigation

fastapi-depends-stub

Prevent FastAPI from digging into real dependencies attributes detecting them as request data.

Installation

You can install fastapi-depends-stub from PyPI:

python -m pip install fastapi-depends-stub

Usage

When declaring your dependency, instead of:

interactor: Annotated[Interactor, Depends()]

You should write:

interactor: Annotated[Interactor, Depends(Stub(Interactor))]

And don't forget to declare how to create your dependency:

app.dependency_overrides[Interactor] = some_real_factory()

Contributing

I believe that there is nothing you can do anymore with this package, but if you have some ideas - you're always welcome!

Credits

All credits go to Tishka17, I've just packed his Stub implementation.

About

Prevent FastAPI from digging into real dependencies attributes detecting them as request data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages