function Body
Since 0.2.0
Body<T = unknown>(): ParamSource<T>

Binds the parsed JSON request body.

Resolves to the validated body when validation middleware wrote one for this request, and to the raw parsed body otherwise — so T is the caller's declaration of what the handler expects, not a guarantee from this package.

Type Parameters

T = unknown

Return Type

A body source

Usage

import { Body } from "decorator-plugin/src/index.ts";