Optionalvalidator: IRequestHeadersValidator<T>Parameter decorator
contracts/common.md#principled-implementation The header record of the request is decoded by the transformed function into the typed object, whose failure is thrown as the response; header names arrive lower-cased from Node, which the generated decoder expects.
contracts/common.md#clear-and-simple-design One parameter decorator built from the shared header validator runner.
contracts/common.md#prohibited-implementation-shortcuts The decoder is generated from the type by the transform; without it the request headers are passed through only when the configuration guard is off.
Type safe HTTP headers decorator.
TypedHeadersis a decorator function that can parse HTTP headers. It is almost same with nest.Headers, but it can automatically cast property type following its DTO definition. Also,TypedHeadersperforms type validation.For reference, target type
Tmust follow such restrictions. Also, if actual HTTP header values are different with their promised typeT,BadRequestExceptionerror (status code: 400) would be thrown.Tmust be an object typenull, butundefinedis possibleboolean,bigint,number,stringor their array types are allowedset-cookiemust be array type