UNPKG

@tsed/common

Version:
56 lines 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Header = void 0; const schema_1 = require("@tsed/schema"); /** * Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter. * * ```typescript * @Header('Content-Type', 'text/plain'); * private myMethod() {} * * @Status(204) * @Header({ * "Content-Type": "text/plain", * "Content-Length": 123, * "ETag": { * "value": "12345", * "description": "header description" * } * }) * private myMethod() {} * ``` * * This example will produce the swagger responses object: * * ```json * { * "responses": { * "204": { * "description": "Description", * "headers": { * "Content-Type": { * "type": "string" * }, * "Content-Length": { * "type": "number" * }, * "ETag": { * "type": "string", * "description": "header description" * } * } * } * } * } * ``` * * @decorator * @operation * @response * @ignore * @deprecated Since v6. Use @Header from @tsed/schema. * @ignore */ exports.Header = schema_1.Header; //# sourceMappingURL=header.js.map