• Type safe body decorator.

    TypedBody is a decorator function getting application/json typed data from request body. Also, it validates the request body data type through typia and the validation speed is maximum 20,000x times faster than class-validator.

    For reference, when the request body data is not following the promised type T, BadRequestException error (status code: 400) would be thrown.

    Type Parameters

    • T

    Parameters

    • Optionalvalidator: IRequestBodyValidator<T>

      Custom validator if required. Default is typia.assert()

    Returns ParameterDecorator

    Jeongho Nam - https://github.com/samchon