# TypeError: missing 1 required positional argument: 'db'

- **ID:** `python/fastapi-depends-missing-parameter`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A dependency function expects a parameter that is not provided by the caller or the dependency injection system.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Ensure the dependency is properly injected using Depends** (95% success)
   ```
   from fastapi import Depends
async def get_db():
    return db
@app.get('/items')
async def read_items(db=Depends(get_db)):
   ```
2. **Define the dependency as a class with __call__** (85% success)
   ```
   class DBSession:
    def __call__(self):
        return db
@app.get('/items')
async def read_items(db=Depends(DBSession())):
   ```

## Dead Ends

- **Adding a default value to the parameter** — May not solve the underlying issue if the dependency is required. (50% fail)
- **Removing the dependency from the route** — Breaks the functionality that requires the dependency. (80% fail)
