UNPKG

@tsed/schema

Version:
20 lines (19 loc) 538 B
import { DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core"; import { JsonEntityFn } from "../common/jsonEntityFn.js"; /** * Set a swagger operationId explicitly. * * @param operationId * @decorator * @swagger * @schema * @operation */ export function OperationId(operationId) { return JsonEntityFn((store, args) => { if (store.decoratorType !== DecoratorTypes.METHOD) { throw new UnsupportedDecoratorType(OperationId, args); } store.operation.operationId(operationId); }); }