# 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-validation-error-field-required`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A required field is missing from the input data when instantiating a Pydantic model. In Pydantic v2, missing fields raise ValidationError instead of silently defaulting.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   from typing import Optional
from pydantic import BaseModel

class User(BaseModel):
    name: Optional[str] = None
    age: int
   ```
2. **** (98% success)
   ```
   user = User(name='Alice', age=25)  # include all required fields
# or
User.model_validate({'name': 'Alice', 'age': 25})
   ```

## Dead Ends

- **** — Silently swallowing ValidationError means downstream code receives an object with missing attributes, causing AttributeError later. (85% fail)
- **** — Pydantic v2 models are immutable by default and reject attribute assignment unless model_config allows it. (70% fail)
