Skip to content

chore: Add OpenAPI Support to commands.get API#36953

Merged
ggazzo merged 7 commits intoRocketChat:developfrom
ahmed-n-abdeltwab:feat/openapi-commands-get
Feb 23, 2026
Merged

chore: Add OpenAPI Support to commands.get API#36953
ggazzo merged 7 commits intoRocketChat:developfrom
ahmed-n-abdeltwab:feat/openapi-commands-get

Conversation

@ahmed-n-abdeltwab
Copy link
Copy Markdown
Contributor

@ahmed-n-abdeltwab ahmed-n-abdeltwab commented Sep 16, 2025

Description:
This PR integrates OpenAPI support into the Rocket.Chat API, migrate of Rocket.Chat API endpoints to the new OpenAPI pattern. The update includes improved API documentation, enhanced type safety, and response validation using AJV.

Key Changes:

  • Implemented the new pattern and added AJV-based JSON schema validation for API.
  • Uses the ExtractRoutesFromAPI utility from the TypeScript definitions to dynamically derive the routes from the endpoint specifications.
  • Enabled Swagger UI integration for this API.
  • Route Methods Chaining for the endpoints.
  • This does not introduce any breaking changes to the endpoint logic.

Issue Reference:
Relates to #34983, part of the ongoing OpenAPI integration effort.

Testing:

  • Verified that the API response schemas are correctly documented in Swagger UI.

  • All tests passed without any breaking changes

    $ yarn testapi -f '[Commands]'
    
    
    [Commands]
      [/commands.get]
        ✔ should return an error when call the endpoint without "command" required parameter
        ✔ should return an error when call the endpoint with an invalid command
        ✔ should return success when parameters are correct
      [/commands.list]
        ✔ should return a list of commands
        ✔ should return a list of commands even requested with count and offset params (196ms)
      [/commands.run]
        ✔ should return an error when call the endpoint without "command" required parameter
        ✔ should return an error when call the endpoint with the param "params" and it is not a string
        ✔ should return an error when call the endpoint without "roomId" required parameter
        ✔ should return an error when call the endpoint with the param "tmid" and it is not a string
        ✔ should return an error when call the endpoint with the invalid "command" param
        ✔ should return an error when call the endpoint with an invalid thread id
        ✔ should return an error when call the endpoint with a valid thread id of wrong channel
        ✔ should return success when parameters are correct (140ms)
      Command archive
        unauthorized cases
          ✔ should return an error when the user is not logged in
          ✔ should return an error when the user has not enough permissions (42ms)
        authorized cases
          ✔ should return a success when the user has enough permissions (77ms)
      Command unarchive
        unauthorized cases
          ✔ should return an error when the user is not logged in
          ✔ should return an error when the user has not enough permissions
        authorized cases
          ✔ should return a success when the user has enough permissions
      Command "invite-all-from"
        ✔ should not add users from group which is not accessible by current user
        ✔ should not add users to a room that is not accessible by the current user
        ✔ should add users from group which is accessible by current user (127ms)
    
    
    22 passing (7s)

Endpoints:

Get Slash Commands

Looking forward to your feedback! 🚀

Summary by CodeRabbit

  • New Features

    • Enhanced command retrieval endpoint with OpenAPI documentation support for improved API integration and discoverability
  • Refactor

    • Modernized route definitions with strengthened validation framework and improved type-safe response handling for better reliability

COMM-144

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Sep 16, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 8.3.0, but it targets 8.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 16, 2025

🦋 Changeset detected

Latest commit: 31bc752

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

This PR includes changesets to release 40 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/rest-typings Patch
@rocket.chat/core-typings Patch
@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 Patch
@rocket.chat/web-ui-registration Patch
@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/uikit-playground Patch
@rocket.chat/apps Patch
@rocket.chat/cron Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-voip Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/ui-video-conf 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
Copy Markdown
Contributor

coderabbitai bot commented Sep 16, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The changes introduce OpenAPI support for Rocket.Chat's commands.get API endpoint by migrating the endpoint definition from rest-typings to the main API file, adding type-safe validation through AJV schemas, and extending the public type surface with proper endpoint exports and validators.

Changes

Cohort / File(s) Summary
Version Bumping
.changeset/wet-roses-call.md
Patch version bump for @rocket.chat/meteor and @rocket.chat/rest-typings packages.
Commands API Implementation
apps/meteor/app/api/server/v1/commands.ts
Adds typed commands.get route with CommandsGetParams schema and compiled validator; refactors endpoint to use action function flow with proper error handling (400 for missing/not found, 200 for success); exports CommandsEndpoints type and augments rest-typings module.
Commands API Tests
apps/meteor/tests/end-to-end/api/commands.ts
Updates test expectation for missing required parameter error message from custom text to JSON Schema validation message.
Rest Typings Updates
packages/rest-typings/src/v1/commands.ts
Removes commands.get endpoint definition; endpoint now defined in main API file instead.
Core Typings Schema Updates
packages/core-typings/src/Ajv.ts
Extends public schemas union to include ISlashCommand for AJV validation support.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hoppy changes! Schemas now align,
Commands typed with validation so fine,
From rest-typings moved to API today,
AJV validators lead the way,
Our requests now have safety divine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely describes the main change: adding OpenAPI support to the commands.get API endpoint, which aligns with the primary objective of the PR.

✏️ 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
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (5)
.changeset/wet-roses-call.md (1)

6-6: Clarify scope and cross-reference the tracking issue

Nit: s/"endpoints"/"endpoint"/ if only commands.get is migrated here, and add "Refs #34983" for traceability.

Apply this diff:

-Add OpenAPI support for the Rocket.Chat commands.get API endpoints by migrating to a modern chained route definition syntax and utilizing shared AJV schemas for validation to enhance API documentation and ensure type safety through response validation.
+Add OpenAPI support for the Rocket.Chat commands.get API endpoint by migrating to a modern chained route definition syntax and utilizing shared Ajv schemas for validation to enhance API documentation and ensure type safety through response validation. Refs #34983.
apps/meteor/app/api/server/v1/commands.ts (3)

65-65: Type the query params

Cast to CommandsGetParams to align with the validated schema and improve editor tooling.

Apply this diff:

-		const params = this.queryParams;
+		const params = this.queryParams as CommandsGetParams;

67-69: Redundant runtime check; Ajv already enforces this

query: isCommandsGetParams rejects missing/non-string command before action() runs. Drop this branch to avoid conflicting messages with schema errors.

Apply this diff:

-		if (typeof params.command !== 'string') {
-			return API.v1.failure('The query param "command" must be provided.');
-		}

29-31: Naming nit: singular endpoint const

It holds a single GET route; singular reads clearer and matches usage in the exported type alias.

Apply this diff:

-const commandsEndpoints = API.v1.get(
+const commandsGetEndpoint = API.v1.get(

and

-export type CommandsEndpoints = ExtractRoutesFromAPI<typeof commandsEndpoints>;
+export type CommandsEndpoints = ExtractRoutesFromAPI<typeof commandsGetEndpoint>;

Also applies to: 385-386

apps/meteor/tests/end-to-end/api/commands.ts (1)

25-25: Avoid brittle equality on Ajv error text

Ajv message wording can change across versions. Assert key fragment instead.

Apply this diff:

-					expect(res.body.error).to.be.equal(`must have required property 'command'`);
+					expect(res.body.error).to.include(`required property 'command'`);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a087f72 and bb7646b.

📒 Files selected for processing (4)
  • .changeset/wet-roses-call.md (1 hunks)
  • apps/meteor/app/api/server/v1/commands.ts (2 hunks)
  • apps/meteor/tests/end-to-end/api/commands.ts (1 hunks)
  • packages/rest-typings/src/v1/commands.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/rest-typings/src/v1/commands.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/end-to-end/api/commands.ts
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/commands.ts (2)
packages/rest-typings/src/v1/Ajv.ts (3)
  • ajv (23-23)
  • validateBadRequestErrorResponse (46-46)
  • validateUnauthorizedErrorResponse (69-69)
packages/rest-typings/src/index.ts (1)
  • Endpoints (52-100)

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.55%. Comparing base (1182145) to head (31bc752).
⚠️ Report is 168 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #36953   +/-   ##
========================================
  Coverage    70.55%   70.55%           
========================================
  Files         3178     3178           
  Lines       111796   111796           
  Branches     20134    20188   +54     
========================================
+ Hits         78878    78881    +3     
+ Misses       30865    30863    -2     
+ Partials      2053     2052    -1     
Flag Coverage Δ
e2e 60.38% <ø> (-0.02%) ⬇️
e2e-api 47.82% <ø> (ø)
unit 71.53% <ø> (+0.01%) ⬆️

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/meteor/app/api/server/v1/commands.ts (2)

37-43: Consider using ISlashCommand for type consistency.

The generic type parameter uses SlashCommand (line 38) while the schema references ISlashCommand (line 43). Although functionally equivalent (ISlashCommand extends SlashCommand), using ISlashCommand consistently would improve clarity and maintain alignment with the schema reference.

Apply this diff for consistency:

-				command: SlashCommand;
+				command: ISlashCommand;
 				success: true;
 			}>({

55-66: Redundant runtime type check after query validation.

The typeof params.command !== 'string' check (line 58) is redundant because the isCommandsGetParams validator (line 33) already ensures command is a required string property. If query validation is properly wired in the framework, this condition will never be true.

Consider removing the redundant check or adding a comment explaining why it's kept (e.g., defense-in-depth):

 	async function action() {
 		const params = this.queryParams;
 
-		if (typeof params.command !== 'string') {
-			return API.v1.failure('The query param "command" must be provided.');
-		}
-
 		const cmd = slashCommands.commands[params.command.toLowerCase()];
 
 		if (!cmd) {
 			return API.v1.failure(`There is no command in the system by the name of: ${params.command}`);
 		}
 
 		return API.v1.success({ command: cmd });
 	},
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 963f49f and 8cdb698.

📒 Files selected for processing (3)
  • apps/meteor/app/api/server/v1/commands.ts (2 hunks)
  • packages/core-typings/src/Ajv.ts (1 hunks)
  • packages/core-typings/src/SlashCommands/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/core-typings/src/SlashCommands/index.ts
🧰 Additional context used
🧬 Code graph analysis (2)
packages/core-typings/src/Ajv.ts (1)
packages/core-typings/src/SlashCommands/index.ts (1)
  • ISlashCommand (60-60)
apps/meteor/app/api/server/v1/commands.ts (2)
packages/rest-typings/src/v1/Ajv.ts (3)
  • ajv (23-23)
  • validateBadRequestErrorResponse (46-46)
  • validateUnauthorizedErrorResponse (69-69)
packages/core-typings/src/SlashCommands/index.ts (1)
  • SlashCommand (46-58)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (2)
packages/core-typings/src/Ajv.ts (1)

9-14: LGTM! ISlashCommand correctly added to public schemas.

The addition of ISlashCommand to the schemas tuple enables AJV validation for slash command types and makes them available for OpenAPI schema references. This aligns with the PR's OpenAPI integration objectives.

apps/meteor/app/api/server/v1/commands.ts (1)

376-381: LGTM! Proper type extraction and module augmentation.

The CommandsEndpoints type correctly extracts routes from the API definition, and the module augmentation properly extends the @rocket.chat/rest-typings Endpoints interface. This enables type-safe consumption of the new typed route throughout the codebase.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8cdb698 and 9d2effc.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/commands.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/commands.ts (3)
packages/rest-typings/src/v1/Ajv.ts (3)
  • ajv (23-23)
  • validateBadRequestErrorResponse (46-46)
  • validateUnauthorizedErrorResponse (69-69)
packages/core-typings/src/SlashCommands/index.ts (1)
  • SlashCommand (46-58)
packages/rest-typings/src/index.ts (1)
  • Endpoints (52-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9d2effc and c669cbd.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/commands.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/commands.ts (3)
packages/rest-typings/src/v1/Ajv.ts (3)
  • ajv (23-23)
  • validateBadRequestErrorResponse (46-46)
  • validateUnauthorizedErrorResponse (69-69)
packages/core-typings/src/SlashCommands/index.ts (1)
  • ISlashCommand (60-60)
packages/rest-typings/src/index.ts (1)
  • Endpoints (52-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c669cbd and 34f8901.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/commands.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/commands.ts (3)
packages/rest-typings/src/v1/Ajv.ts (3)
  • ajv (23-23)
  • validateBadRequestErrorResponse (46-46)
  • validateUnauthorizedErrorResponse (69-69)
packages/core-typings/src/SlashCommands/index.ts (1)
  • ISlashCommand (60-60)
packages/rest-typings/src/index.ts (1)
  • Endpoints (52-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (4)
apps/meteor/app/api/server/v1/commands.ts (4)

1-1: LGTM! Imports correctly support the OpenAPI integration.

The imports bring in the necessary types and validation utilities for the typed endpoint pattern.

Also applies to: 4-4, 11-11


16-27: LGTM! Query parameter type and schema are well-defined.

The type definition and JSON schema are consistent, and the validation setup follows best practices.


55-73: LGTM! Action function correctly handles command lookup and response construction.

The implementation properly:

  • Validates command existence with appropriate error handling
  • Explicitly constructs the response object with only the intended fields (preventing accidental exposure of non-serializable function fields)
  • Uses case-insensitive command lookup

Note: The fields returned here (lines 66-70) should align with the schema definition as flagged in the previous comment.


380-385: LGTM! Type exports and module augmentation correctly expose the new endpoint types.

The pattern properly:

  • Extracts route types from the API class using ExtractRoutesFromAPI
  • Augments @rocket.chat/rest-typings to make the new endpoint discoverable
  • Follows the established convention for typed endpoints

Based on learnings: This aligns with the @rocket.chat/rest-typings package pattern of using declaration merging to extend endpoint typings.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/meteor/app/api/server/v1/commands.ts (1)

16-27: Consider adding minLength constraint to prevent empty command strings.

The query validation correctly requires the command parameter, but doesn't enforce a minimum length. While the current implementation gracefully handles empty strings (returning a failure at line 72), adding minLength: 1 would provide earlier validation feedback.

Optional refinement:

 const CommandsGetParamsSchema = {
 	type: 'object',
 	properties: {
-		command: { type: 'string' },
+		command: { type: 'string', minLength: 1 },
 	},
 	required: ['command'],
 	additionalProperties: false,
 };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 34f8901 and 0ebd2ec.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/commands.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/commands.ts (3)
packages/rest-typings/src/v1/Ajv.ts (3)
  • ajv (23-23)
  • validateBadRequestErrorResponse (46-46)
  • validateUnauthorizedErrorResponse (69-69)
packages/core-typings/src/SlashCommands/index.ts (1)
  • ISlashCommand (60-60)
packages/rest-typings/src/index.ts (1)
  • Endpoints (52-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (3)
apps/meteor/app/api/server/v1/commands.ts (3)

1-1: LGTM! Clean import additions.

The new imports correctly support the OpenAPI integration pattern with proper type imports (ISlashCommand), validation utilities (ajv, error validators), and route extraction (ExtractRoutesFromAPI).

Also applies to: 4-4, 11-11


29-85: Well-structured OpenAPI endpoint with consistent type safety.

The implementation successfully migrates to the new OpenAPI pattern:

  • Query validation with typed schema (line 33)
  • Proper error response schemas (400, 401)
  • Inline 200 response schema precisely matches the 5-field TypeScript generic (lines 37-62)
  • Response construction (lines 75-83) aligns exactly with the schema definition
  • Strict validation via additionalProperties: false (lines 53, 61)

The choice to use an inline schema rather than $ref to full ISlashCommand correctly limits the API surface to only the documented 5 fields, as discussed in previous reviews.


391-396: LGTM! Proper type exports and module augmentation.

The type export and module augmentation correctly expose the new route definitions to the rest-typings package, enabling type-safe API consumption across the codebase.

@ahmed-n-abdeltwab ahmed-n-abdeltwab force-pushed the feat/openapi-commands-get branch from 0dfd2c0 to 0801d77 Compare February 17, 2026 13:18
Key Changes:

- Implemented the new pattern and added AJV-based JSON schema validation for API.
- Uses the ExtractRoutesFromAPI utility from the TypeScript definitions to dynamically derive the routes from the endpoint specifications.
- Enabled Swagger UI integration for this API.
- Route Methods Chaining for the endpoints.
- This does not introduce any breaking changes to the endpoint logic.
@ahmed-n-abdeltwab ahmed-n-abdeltwab force-pushed the feat/openapi-commands-get branch from 0801d77 to f99278b Compare February 18, 2026 07:33
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ebd2ec and f99278b.

📒 Files selected for processing (2)
  • .changeset/wet-roses-call.md
  • apps/meteor/app/api/server/v1/commands.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/app/api/server/v1/commands.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
.changeset/wet-roses-call.md (1)

3-3: The patch version bump is appropriate — /v1/commands.get does not exist in @rocket.chat/rest-typings.

The rest-typings package exports only three command endpoints: /v1/commands.list, /v1/commands.run, and /v1/commands.preview. The /v1/commands.get endpoint mentioned in the commit title refers to implementation changes in the meteor package, not to changes in rest-typings type definitions. There is no removal of a public endpoint from rest-typings, so the patch bump is correct.

Likely an incorrect or invalid review comment.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/wet-roses-call.md:
- Around line 1-4: The changeset currently lists only "@rocket.chat/meteor" and
"@rocket.chat/rest-typings" but you modified files under packages/core-typings
(e.g., src/Ajv.ts), so update .changeset/wet-roses-call.md to include an entry
for "@rocket.chat/core-typings" with an appropriate version bump (patch); ensure
the YAML list includes that package name and "patch" so downstream consumers see
the version change.

Copy link
Copy Markdown
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 5 files


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@ahmed-n-abdeltwab ahmed-n-abdeltwab marked this pull request as draft February 18, 2026 08:32
@ahmed-n-abdeltwab ahmed-n-abdeltwab force-pushed the feat/openapi-commands-get branch from 9080d71 to c0aa2d7 Compare February 19, 2026 11:07
@ahmed-n-abdeltwab
Copy link
Copy Markdown
Contributor Author

@cardoso 👍

@ahmed-n-abdeltwab ahmed-n-abdeltwab marked this pull request as ready for review February 19, 2026 14:47
Copy link
Copy Markdown
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 5 files

@ggazzo ggazzo added this to the 8.3.0 milestone Feb 23, 2026
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Feb 23, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Feb 23, 2026
@ggazzo ggazzo changed the title feat: Add OpenAPI Support to commands.get API chore: Add OpenAPI Support to commands.get API Feb 23, 2026
@ggazzo ggazzo merged commit c117492 into RocketChat:develop Feb 23, 2026
46 checks passed
ahmed-n-abdeltwab added a commit to ahmed-n-abdeltwab/Rocket.Chat that referenced this pull request Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants