feat(docs): implement comprehensive Chat and ChatId schemas for Swagger (#103)
* feat(docs): add ChatId schema definition to swagger.json * feat(docs): integrate ChatId and define base of Chat schema. * feat(docs): add response schema for chat listing
This commit is contained in:
parent
85dbb14b28
commit
c6c746afbc
3 changed files with 150 additions and 6 deletions
|
|
@ -348,8 +348,16 @@ const getContacts = async (req, res) => {
|
|||
* @throws {Error} If the operation fails, an error is thrown.
|
||||
*/
|
||||
const getChats = async (req, res) => {
|
||||
/*
|
||||
#swagger.summary = 'Get all current chats'
|
||||
/* #swagger.summary = 'Get all current chats'
|
||||
#swagger.description = 'Retrieve all chats for the given session ID.'
|
||||
#swagger.responses[200] = {
|
||||
description: 'Retrieved all chats.',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: { "$ref": "#/definitions/GetChatsResponse" }
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
try {
|
||||
const client = sessions.get(req.params.sessionId)
|
||||
|
|
@ -377,6 +385,7 @@ const getChats = async (req, res) => {
|
|||
const getChatsWithSearch = async (req, res) => {
|
||||
/*
|
||||
#swagger.summary = 'Get all current chats with optional search parameters'
|
||||
#swagger.description = 'Retrieve all chats for the given session ID with optional search parameters.'
|
||||
#swagger.requestBody = {
|
||||
required: true,
|
||||
schema: {
|
||||
|
|
@ -399,6 +408,14 @@ const getChatsWithSearch = async (req, res) => {
|
|||
}
|
||||
},
|
||||
}
|
||||
#swagger.responses[200] = {
|
||||
description: 'Retrieved all chats with search parameters.',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {"$ref": "#/definitions/GetChatsResponse"}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
try {
|
||||
const { searchOptions = {} } = req.body
|
||||
|
|
|
|||
Loading…
Reference in a new issue