chore: migrate chat.followMessage and chat.unfollowMessage to OpenAPI

Merged
SE
7mo ago
+108-80

Proposed changes (including videos or screenshots)

Migrate chat.followMessage and chat.unfollowMessage endpoints to the new OpenAPI-compatible chained route definition syntax with AJV body and response validation.

Changes

apps/meteor/app/api/server/v1/chat.ts

  • Defined local types and AJV schemas for ChatFollowMessageLocal and ChatUnfollowMessageLocal
  • Migrated chat.followMessage and chat.unfollowMessage from addRoute() to chained .post() calls on the chatEndpoints chain (after chat.update)
  • Added response validation schemas (200, 400, 401)

packages/rest-typings/src/v1/chat.ts

  • Removed ChatFollowMessage and ChatUnfollowMessage types, schemas, and validators
  • Removed both endpoints from the ChatEndpoints interface

.changeset/migrate-chat-follow-unfollow-message.md

  • Added changeset with minor bump for @rocket.chat/meteor and @rocket.chat/rest-typings

Issue(s)

COMM-144
Tracking: RocketChat/Rocket.Chat-Open-API#150

Swagger UI — chat.followMessage:
image

Swagger UI — chat.unfollowMessage:
image

Summary by CodeRabbit

  • Refactor
    • Updated chat.followMessage and chat.unfollowMessage API endpoints to OpenAPI-style routes with improved request/response validation.
  • Documentation
    • Added a changeset documenting version bumps and enabling OpenAPI support for the chat follow/unfollow endpoints.

Task: ARCH-2019