# fastapi.exceptions.FastAPIError: Duplicate parameter name: 'path' in function 'catch_all'

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

## Root Cause

Defining a catch-all route like `@app.get('/{path}')` after specific routes can cause FastAPI to interpret path parameters incorrectly, leading to duplicate parameter errors or wrong matching.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Define specific routes before catch-all routes, and ensure catch-all uses a distinct parameter name like `{path:path}` with a converter.
   ```
2. **** (85% success)
   ```
   Use `@app.api_route('/{path}', methods=['GET'], include_in_schema=False)` for catch-all to avoid conflicts.
   ```

## Dead Ends

- **** — Reordering routes doesn't fix the duplicate parameter error if the catch-all is too broad. (80% fail)
- **** — Using a different parameter name in the catch-all still conflicts with other routes. (75% fail)
