chore: migrate groups.removeModerator endpoint to new OpenAPI pattern with AJV validations

Approval required
CO
7mo ago
+64-25

Proposed Changes (including screenshots)

This PR migrates the groups.removeModerator endpoint from the legacy API.v1.addRoute pattern to the OpenAPI-compliant format using AJV schema validation, continuing the REST API migration effort.

Key Changes

  • Replaced API.v1.addRoute with chained .post() for groups.removeModerator.
  • Added explicit response schemas for 200, 400, and 401 status codes.
  • Removed the manually written type from packages/rest-typings/src/v1/groups.ts since it is now auto-generated via ExtractRoutesFromAPI.
  • Added a changeset file.
  • Business logic remains unchanged.

Swagger UI

The endpoint is documented in Swagger UI at:

/api-docs/
image image

Test Case

Screenshot 2026-03-05 151319

This follows the same migration pattern established in:

https://github.com/RocketChat/Rocket.Chat-Open-API/pull/150

Summary by CodeRabbit

  • Refactor

    • Modernized the groups.removeModerator API surface to a grouped, OpenAPI-style route with clearer auth, request/response schemas, and standardized validation for more consistent behavior.
  • Chores

    • Cleaned up public REST typings by removing deprecated/duplicate entries and aligning the exported API surface with the updated endpoints.