pydantic_core._pydantic_core.ValidationError: 1 validation error for Model
Data didn’t match a Pydantic model — a field is missing, has the wrong type, or fails a constraint.
validation error forField requiredInput should be a valid 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
- Read each error’s loc and msg
- Mark optional fields: name: str | None = None
- Coerce or validate input upstream
- Use model_validate (v2) instead of parse_obj (v1)
Detailed fix by platform
Python
- python
try: User.model_validate(payload) except ValidationError as e: print(e.errors())
How to diagnose
- Field — loc in each error
- Input — The input value shown
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Python
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026