FastAPI

FastAPI already has its own dependency system, but diwire is still useful when you want:

  • a single, typed object graph shared across your app

  • request/job scopes with deterministic cleanup

  • constructor injection for your domain/services

  • handler signatures that stay friendly for FastAPI (only request parameters are visible)

Runnable examples

See FastAPI for three progressively more advanced FastAPI examples:

  • basic integration with explicit container calls

  • decorator-based layering

  • container_context + middleware-managed request context