Skip to content

fastapi_integration

wireup_init_fastapi_integration

Integrate wireup with a fastapi application.

This must be called once all views have been registered. Decorates all views where container objects are being used making the @container.autowire decorator no longer needed.

Parameters:

Name Type Description Default
app FastAPI

The application instance

required
service_modules list[ModuleType]

A list of python modules where application services reside. These will be loaded to trigger container registrations.

required
dependency_container DependencyContainer

The instance of the dependency container. The default wireup singleton will be used when this is unset. This will be a noop and have no performance penalty for views which do not use the container.

container