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:
Kauã Q. 2026-02-28 15:44:38 -04:00 • committed by GitHub
commit c6c746afbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 150 additions and 6 deletions

View file

@ -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