From 5f0e0d57d0e91a0db3323671c717810c75f6c4c1 Mon Sep 17 00:00:00 2001 From: icleitoncosta Date: Wed, 15 Nov 2023 12:06:24 -0300 Subject: [PATCH] fix: Fixed docs for send-list-message --- src/controller/messageController.ts | 45 ++++++++++++++++++++++- src/swagger.json | 55 ++++++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/src/controller/messageController.ts b/src/controller/messageController.ts index 4db3e88d64..fa2e4ba64b 100644 --- a/src/controller/messageController.ts +++ b/src/controller/messageController.ts @@ -506,7 +506,50 @@ export async function sendListMessage(req: Request, res: Response) { #swagger.parameters["session"] = { schema: 'NERDWHATS_AMERICA', } - #swagger.deprecated=true + #swagger.requestBody = { + required: true, + "@content": { + "application/json": { + schema: { + type: "object", + properties: { + phone: { type: "string" }, + isGroup: { type: "boolean" }, + description: { type: "string" }, + sections: { type: "array" }, + buttonText: { type: "string" }, + } + }, + examples: { + "Send list message": { + value: { + phone: '5521999999999', + isGroup: false, + description: 'Desc for list', + buttonText: 'Select a option', + sections: [ + { + title: 'Section 1', + rows: [ + { + rowId: 'my_custom_id', + title: 'Test 1', + description: 'Description 1', + }, + { + rowId: '2', + title: 'Test 2', + description: 'Description 2', + }, + ], + }, + ], + } + }, + } + } + } + } */ const { phone, diff --git a/src/swagger.json b/src/swagger.json index 1fc081dc7d..e7a3cd715a 100644 --- a/src/swagger.json +++ b/src/swagger.json @@ -1533,7 +1533,60 @@ "bearerAuth": [] } ], - "deprecated": true + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string" + }, + "isGroup": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "sections": { + "type": "array" + }, + "buttonText": { + "type": "string" + } + } + }, + "examples": { + "Send list message": { + "value": { + "phone": "5521999999999", + "isGroup": false, + "description": "Desc for list", + "buttonText": "Select a option", + "sections": [ + { + "title": "Section 1", + "rows": [ + { + "rowId": "my_custom_id", + "title": "Test 1", + "description": "Description 1" + }, + { + "rowId": "2", + "title": "Test 2", + "description": "Description 2" + } + ] + } + ] + } + } + } + } + } + } } }, "/api/{session}/send-order-message": {