UNPKG

@nestjs/swagger

Version:

Nest - modern, fast, powerful node.js web framework (@swagger)

15 lines (14 loc) 505 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const helpers_1 = require("./helpers"); const defaultBodyMetadata = { type: String, required: true }; function ApiBody(options) { const [type, isArray] = helpers_1.getTypeIsArrayTuple(options.type, options.isArray); const param = Object.assign(Object.assign({ in: 'body' }, options), { type, isArray }); return helpers_1.createParamDecorator(param, defaultBodyMetadata); } exports.ApiBody = ApiBody;