chore: migrate users.getStatus endpoint to new OpenAPI pattern with AJV validation

Closed
YA
6mo ago
+51-41

Proposed changes

Migrates the users.getStatus REST API endpoint from the legacy API.v1.addRoute pattern to the new chained API.v1.get() pattern with AJV response schema validation and OpenAPI documentation support.

Closes #34983

Endpoints migrated

EndpointMethodOld PatternNew Pattern
users.getStatusGETaddRoute.get().get() chained

Architectural changes

  • Replaced legacy API.v1.addRoute('users.getStatus', ...) with the new chained .get('users.getStatus', ...) method
  • Added AJV response schema for 200 response with status, _id, and connectionStatus fields
  • Added 401: validateUnauthorizedErrorResponse for unauthorized access handling
  • Wired up ExtractRoutesFromAPI + declare module for automatic type inference
  • Removed manual /v1/users.getStatus typing from rest-typings (now inferred via module augmentation)

Files changed

  • apps/meteor/app/api/server/v1/users.ts — Main migration
  • packages/rest-typings/src/v1/users.ts — Removed old manual typing

Related project

This continues the REST API migration effort described in the GSoC 2026 project: Replace old REST API definitions over the new API.

cc @diego-sampaio @ggazzo

This PR is part of the ongoing REST API migration effort tracked in RocketChat/Rocket.Chat-Open-API#150

Summary by CodeRabbit

  • Refactor

    • Consolidated users.getStatus into a single, modernized GET route with stronger response validation.
    • When requesting your own status, responses may include both status and connectionStatus.
    • Endpoint requires authentication.
  • Documentation

    • OpenAPI documentation for users.getStatus updated.
  • Chores

    • Release entry and package patch updates included.