{"version":3,"file":"api_response.mjs","sources":["../../../src/decorators/api_response.ts"],"sourcesContent":["import type { SetOptional } from 'type-fest'\nimport {\n  type OperationResponseMetadata,\n  OperationResponseMetadataStorage,\n} from '../metadata/operation_response.js'\n\nexport type ApiResponseOptions = SetOptional<OperationResponseMetadata, 'status' | 'mediaType'>\n\n/**\n * Configures a response.\n * Can be applied to Controllers and Operations.\n *\n * @see https://swagger.io/specification/#response-object\n */\nexport function ApiResponse(options: ApiResponseOptions) {\n  return function (target: Object, propertyKey?: string | symbol) {\n    const metadata = {\n      status: 'default' as const,\n      mediaType: 'application/json',\n      ...options,\n    }\n    OperationResponseMetadataStorage.mergeMetadata(\n      target,\n      {\n        [metadata.status.toString()]: metadata,\n      },\n      propertyKey\n    )\n  }\n}\n"],"names":[],"mappings":";;AAcO,SAAS,YAAY,OAAA,EAA6B;AACvD,EAAA,OAAO,SAAU,QAAgB,WAAA,EAA+B;AAC9D,IAAA,MAAM,QAAA,GAAW;AAAA,MACf,MAAA,EAAQ,SAAA;AAAA,MACR,SAAA,EAAW,kBAAA;AAAA,MACX,GAAG;AAAA,KACL;AACA,IAAA,gCAAA,CAAiC,aAAA;AAAA,MAC/B,MAAA;AAAA,MACA;AAAA,QACE,CAAC,QAAA,CAAS,MAAA,CAAO,QAAA,EAAU,GAAG;AAAA,OAChC;AAAA,MACA;AAAA,KACF;AAAA,EACF,CAAA;AACF;;;;"}