UNPKG

alapa

Version:

A cutting-edge web development framework designed to revolutionize the way developers build modern web applications.

24 lines (23 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.openapiRequestBody = openapiRequestBody; /* eslint-disable @typescript-eslint/no-explicit-any */ // request-body.ts require("reflect-metadata"); const entry_1 = require("../builder/entry"); // import { METHOD_KEY, ROUTE_KEY } from "./keys"; // import { openApiDefinitionsPaths } from "./entry"; // Ensure this file is correctly referenced function openapiRequestBody() { return function (target, propertyKey, parameterIndex) { // console.log(target, propertyKey, parameterIndex); // const route = Reflect.getMetadata(ROUTE_KEY, target, propertyKey); // const method = Reflect.getMetadata(METHOD_KEY, target, propertyKey); // if (!route || !method) { // throw new Error("Route or method metadata is missing"); // } if (!entry_1.temporalCollections["requestBody"]) { entry_1.temporalCollections["requestBody"] = {}; } entry_1.temporalCollections["requestBody"][propertyKey] = parameterIndex; }; }