Skip to content

docs(swagger): enhance label schemas and endpoint response documentation#113

Open
kaua-alves-queiros wants to merge 9 commits into
avoylenko:mainfrom
kaua-alves-queiros:main
Open

docs(swagger): enhance label schemas and endpoint response documentation#113
kaua-alves-queiros wants to merge 9 commits into
avoylenko:mainfrom
kaua-alves-queiros:main

Conversation

@kaua-alves-queiros
Copy link
Copy Markdown
Contributor

📚 API Documentation Enhancement – Label Schemas & Endpoint Refinement

This PR improves the API documentation by introducing explicit schemas for label-related responses and standardizing existing definitions. It ensures the Swagger UI accurately reflects the data structures used for label management and chat association.

✅ Changes

Schema Definitions

Added or updated the following schemas in swagger.js and swagger.json:

  • SuccessResponse: Standard schema for generic success indicators.
  • GetLabelResponse: Renamed from GetLabelByIdResponse for better naming consistency.
  • GetLabelsResponse: Renamed from GetAllLabelsResponse to align with the retrieval pattern.
  • GetChatLabelsResponse: Introduced to explicitly define the array of labels associated with a specific chat.

Controller Integration

Updated the Swagger annotations in src/controllers/clientController.js to leverage the new $ref definitions for the following endpoints:

  • getChatLabels: Now explicitly returns GetChatLabelsResponse.
  • getChatsByLabelId: Now explicitly returns GetChatsResponse.
  • addOrRemoveLabels: Now utilizes SuccessResponse.
  • getLabelById & getLabels: References updated to use the new standardized schema names.

Documentation Clarity

Standardized naming conventions for all label-related schemas to ensure a predictable and professional API documentation experience.

🚀 Impact

Provides clear and consistent expectations for Label-related data structures, ensuring developers have precise information regarding response formats when managing WhatsApp labels.


Base Head: c6c746a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant