Skip to content

refactor(api): update roles REST endpoints to typed TypeBox validateParams#39213

Open
Harshit2405-2004 wants to merge 8 commits intoRocketChat:developfrom
Harshit2405-2004:refactor-roles-rest-typings
Open

refactor(api): update roles REST endpoints to typed TypeBox validateParams#39213
Harshit2405-2004 wants to merge 8 commits intoRocketChat:developfrom
Harshit2405-2004:refactor-roles-rest-typings

Conversation

@Harshit2405-2004
Copy link

Description

Currently, in \�pps/meteor/app/api/server/v1/roles.ts, the legacy endpoints map custom syntax validation bounds inside the execution block instead of relying on the native REST typings map parameter \�alidateParams.

This PR officially migrates the following endpoints mapped to @rocket.chat/rest-typings\ TypeBox bounds, effectively completing their domain migration to exact the GSoC Replace Old REST API Definition goals:


  • oles.addUserToRole`n-
    oles.getUsersInRole`n-
    oles.delete`n-
    oles.removeUserFromRole`n-
    oles.sync`n
    (Also exposed the missing runtime validation interface schema \isRoleSyncProps\ inside
    est-typings)

Checklist

  • I have added a changeset

@Harshit2405-2004 Harshit2405-2004 requested review from a team as code owners March 1, 2026 09:59
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 1, 2026

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

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.

2 issues found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".changeset/refactor-roles-rest-typing.md">

<violation number="1" location=".changeset/refactor-roles-rest-typing.md:9">
P2: Changeset files must have a single YAML frontmatter block at the top. This file has a second frontmatter block for `meteor`, which will be treated as markdown and the `meteor` bump will be ignored.</violation>
</file>

<file name="apps/meteor/app/api/server/v1/roles.ts">

<violation number="1" location="apps/meteor/app/api/server/v1/roles.ts:4">
P2: `roles.getUsersInRole` was likely missed in the TypeBox `validateParams` migration: the validator `isRolesGetUsersInRoleProps` is imported but never assigned to `validateParams`, leaving query params unvalidated and the import unused.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants