Optionalvalidator: IRequestBodyValidator<T>
Custom validator if required. Default is typia.validate()
contracts/common.md#principled-implementation An absent body with no content type is accepted only when the validator accepts undefined; any other body must be application/json. The checker returns explicitly tagged successful data or the existing validation error, so cloned values reach the argument while raw request.body retains its identity and errors retain their response priority.
contracts/common.md#clear-and-simple-design One parameter decorator composes shared media/absence checks and tagged resolution. The shared internal runner owns descriptor selection and error translation; PlainBody uses the same successful-value protocol for its optional transformed text assertion, preserving raw text when no assertion exists and preserving its absent-input/media error priority.
contracts/common.md#prohibited-implementation-shortcuts The validator is generated from the type by the transform; without it the decorator throws the configuration error unless the guard is turned off.
Type safe body decorator.
TypedBodyis a decorator function gettingapplication/jsontyped data from request body. Also, it validates the request body data type through typia using the declared TypeScript type.For reference, when the request body data is not following the promised type
T,BadRequestExceptionerror (status code: 400) would be thrown. Successful assert and validate callbacks supply the decorated argument; clone validators can therefore return a copy without replacing the raw body.