Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(plugins): declare the 413 for an oversized plugin upload
Yudhi Armyndharisb296183a8dc4
diff --git a/src/modules/plugins/plugins.controller.spec.ts b/src/modules/plugins/plugins.controller.spec.tsindex 8b3c27313..7569827c8 100644--- a/src/modules/plugins/plugins.controller.spec.ts+++ b/src/modules/plugins/plugins.controller.spec.ts@@ -50,3 +50,13 @@ describe('PluginsController authorization', () => {expect(reflector.get<boolean>(UNSCOPED_KEY, handler)).toBe(true);});});++describe('PluginsController.install() OpenAPI responses', () => {+ it('declares the 413 the upload size limit returns', () => {+ const responses = Reflect.getMetadata(+ 'swagger/apiResponse',+ Object.getOwnPropertyDescriptor(PluginsController.prototype, 'install')!.value as object,+ ) as Record<string, unknown>;+ expect(Object.keys(responses)).toContain('413');+ });+});diff --git a/src/modules/plugins/plugins.controller.ts b/src/modules/plugins/plugins.controller.tsindex a86f7c1ae..d5f6549f2 100644--- a/src/modules/plugins/plugins.controller.ts+++ b/src/modules/plugins/plugins.controller.ts@@ -70,6 +70,7 @@ export class PluginsController {@ApiResponse({ status: 201, description: 'Plugin installed', type: PluginDto })@ApiResponse({ status: 400, description: 'Invalid package' })@ApiResponse({ status: 409, description: 'Plugin already installed' })+ @ApiResponse({ status: 413, description: 'Package exceeds the 5 MB upload limit' })install(@UploadedFile() file: { buffer?: Buffer }): PluginDto {return this.pluginsService.install(file);}