# fastapi.exceptions.RequestValidationError: [{'loc': ['query', 'page'], 'msg': 'field required', 'type': 'value_error.missing'}]

- **ID:** `python/fastapi-query-param-missing`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A required query parameter is not provided in the request URL.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Provide a default value: def read_items(page: int = 1)
   ```
2. **** (90% success)
   ```
   Make it optional with Optional[int] = None and handle None in the function
   ```

## Dead Ends

- **** — If the default is set, FastAPI won't raise an error; the error occurs only when no default is given. (30% fail)
- **** — This handles the error but doesn't fix the missing parameter; the client still needs to send it. (60% fail)
