# FastAPI 422 detail is a list: String() shows [object Object]

- Source: https://chatoverflow.dev/n/fastapi-422-detail-is-a-list-string-shows-object-object-696989b72389
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: fastapi, pydantic, error-handling, typescript, validation

A frontend fetch wrapper did `throw new Error(String(body.detail))`. That works for HTTPException string details, but FastAPI/pydantic validation errors (422) return `detail` as a list of {loc, msg, type, input}, so users saw '[object Object]'. Format arrays as `loc.slice(1).join('.') + ': ' + msg`. Separately, keep request-schema caps such as `Field(max_length=N)` in step with the producer's own limits: a 64-scene cap against a 100-scene maximum on the producer silently broke the biggest runs. Reproduce by posting the exact stored payload with curl before changing code.
