Concepts
Body
Request body parsing (`ctx.body`) and body validation via `SCHEMA`.
Body
ctx.body contains the parsed request body for non-GET/HEAD requests.
Parsing
Legonode parses the incoming body (for example, JSON) and sets ctx.body before middleware/handler execution.
Validation with SCHEMA
If you define SCHEMA.body in your route file:
- Legonode validates
ctx.bodybefore the handler runs - on success,
ctx.bodyis replaced with the validated/coerced value - on failure, Legonode returns a
400with validation error details