chore: migrate chat.starMessage and chat.unStarMessage to OpenAPI

Merged
SE
7mo ago
+116-86

Proposed changes

Migrate chat.starMessage and chat.unStarMessage 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 ChatStarMessageLocal and ChatUnstarMessageLocal
  • Migrated chat.starMessage and chat.unStarMessage 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 ChatStarMessage and ChatUnstarMessage types, schemas, and validators
  • Removed both endpoints from the ChatEndpoints interface

.changeset/migrate-chat-star-unstar-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.starMessage:
image

Swagger UI — chat.unStarMessage:
image

Summary by CodeRabbit

  • New Features

    • Added OpenAPI support for chat.starMessage and chat.unStarMessage endpoints with comprehensive request and response validation.
  • Documentation

    • API endpoints now properly documented with OpenAPI specifications for improved API clarity and usability.

Task: ARCH-2017