From dfe4b70d91d92e2b57450b860e786a1c0fbb3df3 Mon Sep 17 00:00:00 2001 From: Francois Falala-Sechet Date: Mon, 17 Aug 2020 09:37:12 +0200 Subject: [PATCH] chore: update swagger definitions (#1151) update swagger definitions --- .../definitions/request/contact/create.yml | 9 ++++-- .../request/conversation/create_message.yml | 7 ++--- swagger/paths/contact/list_create.yml | 1 + swagger/swagger.json | 28 +++++++++++++------ 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/swagger/definitions/request/contact/create.yml b/swagger/definitions/request/contact/create.yml index 6e83a12fa..5dc481a76 100644 --- a/swagger/definitions/request/contact/create.yml +++ b/swagger/definitions/request/contact/create.yml @@ -1,6 +1,11 @@ type: object properties: - account_id: - type: number inbox_id: type: number + required: true + name: + type: string + email: + type: string + phone_number: + type: string diff --git a/swagger/definitions/request/conversation/create_message.yml b/swagger/definitions/request/conversation/create_message.yml index caa5dcd36..faecf278f 100644 --- a/swagger/definitions/request/conversation/create_message.yml +++ b/swagger/definitions/request/conversation/create_message.yml @@ -1,13 +1,12 @@ type: object properties: - conversation_id: - type: number - description: ID of the conversation - required: true content: type: string description: The content of the message required: true + message_type: + type: string + enum: ['outgoing', 'incoming'] private: type: boolean description: Flag to identify if it is a private note diff --git a/swagger/paths/contact/list_create.yml b/swagger/paths/contact/list_create.yml index eed02018f..28689b78d 100644 --- a/swagger/paths/contact/list_create.yml +++ b/swagger/paths/contact/list_create.yml @@ -23,6 +23,7 @@ post: - Contact operationId: contactCreate description: Create New Contact + summary: Create Contact parameters: - name: data in: body diff --git a/swagger/swagger.json b/swagger/swagger.json index 9fc9a31df..8af12d335 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -767,6 +767,7 @@ ], "operationId": "contactCreate", "description": "Create New Contact", + "summary": "Create Contact", "parameters": [ { "name": "data", @@ -1446,11 +1447,18 @@ "contact_create": { "type": "object", "properties": { - "account_id": { - "type": "number" - }, "inbox_id": { - "type": "number" + "type": "number", + "required": true + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone_number": { + "type": "string" } } }, @@ -1471,16 +1479,18 @@ "conversation_message_create": { "type": "object", "properties": { - "conversation_id": { - "type": "number", - "description": "ID of the conversation", - "required": true - }, "content": { "type": "string", "description": "The content of the message", "required": true }, + "message_type": { + "type": "string", + "enum": [ + "outgoing", + "incoming" + ] + }, "private": { "type": "boolean", "description": "Flag to identify if it is a private note"