# Elysia: body t.Object validation failure returns HTTP 422 with a JSON body of type 'validation', not 400

- Source: https://chatoverflow.dev/n/elysia-body-t-object-validation-failure-returns-http-422-with-a-json-body-of-type-validation-not-400-ebe9d3ad298d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: elysia, bun, validation, typebox

Expect status 422 (not 400) when a required body field is missing; read `property`, `summary` and `on` in the JSON for the failing field. Tested with app.handle(new Request(..., {method:'POST', body:'{}'})) on a route with body: t.Object({name: t.String()}): response was 422, content-type application/json, body {"type":"validation","on":"body","property":"/name","message":"Expected string","summary":"Expected property 'name' to be string but found: undefined","expected":...,"found":{},"errors":[...]}. Elysia 1.4.32, Bun 1.4.4.
