Skip to content

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

Merged
ggazzo merged 1 commit intoRocketChat:developfrom
sezallagwal:chore/openapi-chat-star-unstar-message
Mar 2, 2026
Merged

chore: migrate chat.starMessage and chat.unStarMessage to OpenAPI#39227
ggazzo merged 1 commit intoRocketChat:developfrom
sezallagwal:chore/openapi-chat-star-unstar-message

Conversation

@sezallagwal
Copy link
Contributor

@sezallagwal sezallagwal commented Mar 1, 2026

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)

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

@sezallagwal sezallagwal requested review from a team as code owners March 1, 2026 18:54
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 1, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 1, 2026

🦋 Changeset detected

Latest commit: 2c5740f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/rest-typings Minor
@rocket.chat/api-client Patch
@rocket.chat/core-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/http-router Patch
@rocket.chat/models Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/livechat Patch
@rocket.chat/mock-providers Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch
@rocket.chat/ui-client Major
@rocket.chat/media-calls Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/core-typings Minor
@rocket.chat/apps Patch
@rocket.chat/model-typings Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

Walkthrough

This PR migrates the chat.starMessage and chat.unStarMessage API endpoints from globally-exported validation types and schemas to locally-scoped validation. The changes update endpoint definitions with improved OpenAPI support using chained route syntax and AJV schemas.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/migrate-chat-star-unstar-message.md
Changelog entry documenting OpenAPI support for chat.starMessage and chat.unStarMessage endpoints using chained route definition syntax and AJV schema validation.
Local Validation Migration
apps/meteor/app/api/server/v1/chat.ts
Removed imports of public validators; introduced local types ChatStarMessageLocal and ChatUnstarMessageLocal with corresponding AJV schemas and validators; replaced public routes with new locally-validated routes for chat.starMessage and chat.unStarMessage endpoints.
Public Type Exports Removal
packages/rest-typings/src/v1/chat.ts
Removed exported types ChatStarMessage and ChatUnstarMessage along with their schemas and validators; removed /v1/chat.starMessage and /v1/chat.unStarMessage endpoint definitions from the ChatEndpoints interface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: migrating two chat endpoints (chat.starMessage and chat.unStarMessage) to OpenAPI-compatible syntax with AJV validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Copy link
Contributor

@ahmed-n-abdeltwab ahmed-n-abdeltwab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but also same as #39225 you need to test this local before running in the CI

@ahmed-n-abdeltwab
Copy link
Contributor

@ggazzo 👍

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.69%. Comparing base (3c30636) to head (2c5740f).
⚠️ Report is 10 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39227      +/-   ##
===========================================
- Coverage    70.76%   70.69%   -0.07%     
===========================================
  Files         3195     3195              
  Lines       113106   113106              
  Branches     20522    20519       -3     
===========================================
- Hits         80041    79963      -78     
- Misses       31018    31093      +75     
- Partials      2047     2050       +3     
Flag Coverage Δ
e2e 60.40% <ø> (-0.04%) ⬇️
e2e-api 47.79% <ø> (-0.06%) ⬇️
unit 71.31% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ggazzo
Copy link
Member

ggazzo commented Mar 2, 2026

/jira ARCH-1464

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Mar 2, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 2, 2026
@dionisio-bot dionisio-bot bot enabled auto-merge March 2, 2026 14:53
@ggazzo ggazzo disabled auto-merge March 2, 2026 14:53
@dionisio-bot dionisio-bot bot enabled auto-merge March 2, 2026 14:54
@ggazzo ggazzo disabled auto-merge March 2, 2026 14:54
@ggazzo ggazzo merged commit a4341ec into RocketChat:develop Mar 2, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: chore

Projects

Development

Successfully merging this pull request may close these issues.

3 participants