UNPKG

536 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.refs = exports.getSchemaPath = void 0;
4const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
5function getSchemaPath(model) {
6 const modelName = (0, shared_utils_1.isString)(model) ? model : model && model.name;
7 return `#/components/schemas/${modelName}`;
8}
9exports.getSchemaPath = getSchemaPath;
10function refs(...models) {
11 return models.map((item) => ({
12 $ref: getSchemaPath(item.name)
13 }));
14}
15exports.refs = refs;