# pydantic_core._pydantic_core.ValidationError: 1 validation error for User
name
  Field required [type=missing, input_value={'age': 25}, input_type=dict]

- **ID:** `python/pydantic-v2-field-required-missing`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A required field was omitted from the input data. In Pydantic v2, fields without a default are mandatory, and passing a dict that lacks them raises a missing-field ValidationError.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Provide a default value: `name: str = ''` or `name: str = Field(default='unknown')`. Use `Optional[str] = None` if the field is genuinely optional.
   ```
2. **** (88% success)
   ```
   Use model_validate with a pre-filled dict: `User.model_validate({'name': 'anon', **input_data})` so missing keys fall back to defaults.
   ```
3. **** (70% success)
   ```
   Validate partial data with `User.model_construct(**input_data)` when you only need a best-effort object without validation.
   ```

## Dead Ends

- **** — Hides the real data problem; downstream code receives an incomplete or default object and fails later with confusing AttributeError (75% fail)
- **** — extra='allow' only affects unexpected fields, not missing required ones; the ValidationError persists (90% fail)
