From 9eefec31b35589350eac56077347a5f0bb96ed2d Mon Sep 17 00:00:00 2001 From: Daniel Jimenez Date: Mon, 12 May 2025 12:32:40 +1200 Subject: [PATCH] feat: Add examples to request payloads --- .../request/account/create_update_payload.yml | 26 +++++++++++++ .../account_user/create_update_payload.yml | 2 + .../agent_bot/create_update_payload.yml | 9 ++++- .../request/user/create_update_payload.yml | 9 ++++- swagger/swagger.json | 38 ++++++++++++++----- 5 files changed, 73 insertions(+), 11 deletions(-) diff --git a/swagger/definitions/request/account/create_update_payload.yml b/swagger/definitions/request/account/create_update_payload.yml index 63c0eed13..b11b82373 100644 --- a/swagger/definitions/request/account/create_update_payload.yml +++ b/swagger/definitions/request/account/create_update_payload.yml @@ -3,3 +3,29 @@ properties: name: type: string description: Name of the account + example: 'My Account' + locale: + type: string + description: The locale of the account + example: 'en' + domain: + type: string + description: The domain of the account + example: 'example.com' + support_email: + type: string + description: The support email of the account + example: 'support@example.com' + status: + type: string + enum: ['active', 'suspended'] + description: The status of the account + example: 'active' + limits: + type: object + description: The limits of the account + example: {} + custom_attributes: + type: object + description: The custom attributes of the account + example: {} diff --git a/swagger/definitions/request/account_user/create_update_payload.yml b/swagger/definitions/request/account_user/create_update_payload.yml index 5d9407b6f..d2982c4cf 100644 --- a/swagger/definitions/request/account_user/create_update_payload.yml +++ b/swagger/definitions/request/account_user/create_update_payload.yml @@ -6,6 +6,8 @@ properties: user_id: type: integer description: The ID of the user + example: 1 role: type: string description: whether user is an administrator or agent + example: administrator diff --git a/swagger/definitions/request/agent_bot/create_update_payload.yml b/swagger/definitions/request/agent_bot/create_update_payload.yml index 4dc74bea3..e14c1ba7c 100644 --- a/swagger/definitions/request/agent_bot/create_update_payload.yml +++ b/swagger/definitions/request/agent_bot/create_update_payload.yml @@ -3,9 +3,16 @@ properties: name: type: string description: The name of the agent bot + example: 'My Agent Bot' description: type: string - description: The description about the agent bot + description: The description of the agent bot + example: 'This is a sample agent bot' outgoing_url: type: string description: The webhook URL for the bot + example: 'https://example.com/webhook' + account_id: + type: integer + description: The account ID to associate the agent bot with + example: 1 diff --git a/swagger/definitions/request/user/create_update_payload.yml b/swagger/definitions/request/user/create_update_payload.yml index e14a25317..1bebdc59c 100644 --- a/swagger/definitions/request/user/create_update_payload.yml +++ b/swagger/definitions/request/user/create_update_payload.yml @@ -3,13 +3,20 @@ properties: name: type: string description: Name of the user + example: 'Daniel' + display_name: + type: string + description: Display name of the user + example: 'Dan' email: type: string description: Email of the user + example: 'daniel@acme.inc' password: type: string description: Password must contain uppercase, lowercase letters, number and a special character + example: 'Password2!' custom_attributes: type: object description: Custom attributes you want to associate with the user - + example: {} diff --git a/swagger/swagger.json b/swagger/swagger.json index 9e6c94a98..6f2079e8d 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -8732,11 +8732,13 @@ "properties": { "user_id": { "type": "integer", - "description": "The ID of the user" + "description": "The ID of the user", + "example": 1 }, "role": { "type": "string", - "description": "whether user is an administrator or agent" + "description": "whether user is an administrator or agent", + "example": "administrator" } } }, @@ -8745,15 +8747,23 @@ "properties": { "name": { "type": "string", - "description": "The name of the agent bot" + "description": "The name of the agent bot", + "example": "My Agent Bot" }, "description": { "type": "string", - "description": "The description about the agent bot" + "description": "The description of the agent bot", + "example": "This is a sample agent bot" }, "outgoing_url": { "type": "string", - "description": "The webhook URL for the bot" + "description": "The webhook URL for the bot", + "example": "https://example.com/webhook" + }, + "account_id": { + "type": "integer", + "description": "The account ID to associate the agent bot with", + "example": 1 } } }, @@ -8762,19 +8772,29 @@ "properties": { "name": { "type": "string", - "description": "Name of the user" + "description": "Name of the user", + "example": "Daniel" + }, + "display_name": { + "type": "string", + "description": "Display name of the user", + "example": "Dan" }, "email": { "type": "string", - "description": "Email of the user" + "description": "Email of the user", + "example": "daniel@acme.inc" }, "password": { "type": "string", - "description": "Password must contain uppercase, lowercase letters, number and a special character" + "description": "Password must contain uppercase, lowercase letters, number and a special character", + "example": "Password2!" }, "custom_attributes": { "type": "object", - "description": "Custom attributes you want to associate with the user" + "description": "Custom attributes you want to associate with the user", + "example": { + } } } },