# pydantic_core._pydantic_core.ValidationError: 1 validation error for Model

**Code:** `Pydantic ValidationError` · **Category:** Python · **Seen on:** Python

Data didn’t match a Pydantic model — a field is missing, has the wrong type, or fails a constraint.

## Meaning

Each error lists the field location, the problem and the input value. FastAPI turns these into 422 responses for request bodies.

## Common causes

- Missing required field
- Wrong type (string where int expected, null where not Optional)
- Extra fields with extra="forbid"
- Pydantic v1 code on v2 (renamed methods/config)

## Quick fix

1. Read each error’s loc and msg
2. Mark optional fields: name: str | None = None
3. Coerce or validate input upstream
4. Use model_validate (v2) instead of parse_obj (v1)

## Detailed fix by platform

### Python

1. 

```python
try: User.model_validate(payload)
except ValidationError as e: print(e.errors())
```


## How to diagnose

1. **Field** — loc in each error
2. **Input** — The input value shown

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/python/pydantic-validationerror)
