# fastapi.exceptions.RequestValidationError: field required (type=value_error.missing)

- **ID:** `python/fastapi-validation-error-missing-field`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A required field in the request body or query parameters is missing.

## Version Compatibility

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

## Workarounds

1. **Add the missing field in the request body or query parameters with a valid value.** (95% success)
   ```
   {"name": "John", "age": 30}  # Include all required fields
   ```
2. **Modify the Pydantic model to make the field optional with a default value.** (85% success)
   ```
   from pydantic import BaseModel
class Item(BaseModel):
    name: str = None  # Optional with default
   ```

## Dead Ends

- **Setting the field as Optional in the Pydantic model but not providing a default value.** — Optional without default still requires the field in validation; it only allows None. (60% fail)
- **Ignoring the error and sending the same request again without changes.** — The request is still malformed; the error will persist. (95% fail)
