1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const lodash_1 = require("lodash");
|
4 | const helpers_1 = require("./helpers");
|
5 | const defaultParamMetadata = {
|
6 | name: '',
|
7 | required: true
|
8 | };
|
9 | exports.ApiImplicitParam = (metadata) => {
|
10 | const param = {
|
11 | name: lodash_1.isNil(metadata.name) ? defaultParamMetadata.name : metadata.name,
|
12 | in: 'path',
|
13 | description: metadata.description,
|
14 | required: metadata.required,
|
15 | type: metadata.type,
|
16 | enum: undefined
|
17 | };
|
18 | if (metadata.enum) {
|
19 | param.type = String;
|
20 | param.enum = metadata.enum;
|
21 | }
|
22 | return helpers_1.createParamDecorator(param, defaultParamMetadata);
|
23 | };
|