feat: Update swagger to openapi 3.0.4, update request payloads with examples (#11374)

This commit is contained in:
Daniel Jimenez
2025-05-22 19:26:44 +12:00
committed by GitHub
parent 8697a30dc5
commit 4b417ce9e7
189 changed files with 10098 additions and 5847 deletions

View File

@@ -4,16 +4,22 @@ operationId: create-a-contact
summary: Create a contact
description: Create a contact
security: []
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/public_contact_create_update_payload'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/public_contact_create_update_payload'
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_contact'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_contact'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -5,11 +5,21 @@ summary: Get a contact
description: Get the details of a contact
security: []
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_contact'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_contact'
'401':
description: Unauthorized
404:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: The given contact does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -4,16 +4,22 @@ operationId: update-a-contact
summary: Update a contact
description: Update a contact's attributes
security: []
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/public_contact_create_update_payload'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/public_contact_create_update_payload'
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_contact'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_contact'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -4,16 +4,22 @@ operationId: create-a-conversation
summary: Create a conversation
description: Create a conversation
security: []
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/public_conversation_create_payload'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/public_conversation_create_payload'
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_conversation'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_conversation'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,13 +3,20 @@ tags:
operationId: list-all-contact-conversations
summary: List all conversations
description: List all conversations for the contact
security: []
responses:
200:
'200':
description: Success
schema:
type: array
description: 'Array of conversations'
items:
$ref: '#/definitions/public_conversation'
401:
content:
application/json:
schema:
type: array
description: 'Array of conversations'
items:
$ref: '#/components/schemas/public_conversation'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,12 +3,23 @@ tags:
operationId: get-single-conversation
summary: Get a single conversation
description: Retrieves the details of a specific conversation
security: []
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_conversation'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_conversation'
'401':
description: Unauthorized
404:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,12 +3,23 @@ tags:
operationId: resolve-conversation
summary: Resolve a conversation
description: Marks a conversation as resolved
security: []
responses:
200:
'200':
description: Conversation resolved successfully
schema:
$ref: '#/definitions/public_conversation'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_conversation'
'401':
description: Unauthorized
404:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,16 +3,38 @@ tags:
operationId: toggle-typing-status
summary: Toggle typing status
description: Toggles the typing status in a conversation
security: []
parameters:
- name: typing_status
in: query
required: true
type: string
schema:
type: string
description: Typing status, either 'on' or 'off'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
typing_status:
type: string
enum: ['on', 'off']
description: The typing status to set
example: 'on'
responses:
200:
'200':
description: Typing status toggled successfully
401:
'401':
description: Unauthorized
404:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,10 +3,19 @@ tags:
operationId: update-last-seen
summary: Update last seen
description: Updates the last seen time of the contact in a conversation
security: []
responses:
200:
'200':
description: Last seen updated successfully
401:
'401':
description: Unauthorized
404:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -4,16 +4,22 @@ operationId: create-a-message
summary: Create a message
description: Create a message
security: []
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/public_message_create_payload'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/public_message_create_payload'
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_message'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_message'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -3,13 +3,20 @@ tags:
operationId: list-all-converation-messages
summary: List all messages
description: List all messages in the conversation
security: []
responses:
200:
'200':
description: Success
schema:
type: array
description: 'Array of messages'
items:
$ref: '#/definitions/public_message'
401:
content:
application/json:
schema:
type: array
description: 'Array of messages'
items:
$ref: '#/components/schemas/public_message'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -4,16 +4,22 @@ operationId: update-a-message
summary: Update a message
description: Update a message
security: []
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/public_message_update_payload'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/public_message_update_payload'
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_message'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_message'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -5,11 +5,21 @@ summary: Inbox details
description: Get the details of an inbox
security: []
responses:
200:
'200':
description: Success
schema:
$ref: '#/definitions/public_inbox'
401:
content:
application/json:
schema:
$ref: '#/components/schemas/public_inbox'
'401':
description: Unauthorized
404:
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: The given inbox does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'