# AssertionError: Duplicate route: /items

- **ID:** `python/fastapi-duplicate-route`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

FastAPI does not allow defining two route handlers for the same HTTP method and path.

## Version Compatibility

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

## Workarounds

1. **Remove or comment out the duplicate route** (100% success)
   ```
   # Remove the second @app.get('/items') decorator
   ```
2. **Use different HTTP methods or paths** (100% success)
   ```
   @app.get('/items')
def list_items(): ...
@app.post('/items')
def create_item(): ...
   ```

## Dead Ends

- **Renaming one function without changing the route** — The route path and method are still duplicated. (100% fail)
- **Adding a prefix to one route manually** — If the prefix doesn't change the full path, duplication persists. (80% fail)
