chore: Add OpenAPI Support to custom-user-status.list API
Merged
AH
7mo ago+128+128+012345678901234567890123456789-75-75-01234567890123456789
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 '[CustomUserStatus]' [CustomUserStatus] [/custom-user-status.list] ✔ should return custom user status (40ms) ✔ should return custom user status even requested with count and offset params ✔ should return one custom user status when requested with id param ✔ should return empty array when requested with an existing name param ✔ should return empty array when requested with unknown name param 5 passing (904ms)
Endpoints:
Looking forward to your feedback! 🚀
Summary by CodeRabbit
- New Features
- OpenAPI-backed, schema-validated custom-user-status list with pagination and structured responses.
- Documentation
- Improved API documentation and discoverability for custom user status operations.
- Refactor
- List endpoint migrated to a modern, schema-driven routing approach with formal request/response contracts and error handling.
- Chores
- Patched related typing/dependency packages and updated public REST typings for custom-user-status endpoints.