refactor(api): migrate banners GET endpoint to OpenAPI with AJV validation#39404
refactor(api): migrate banners GET endpoint to OpenAPI with AJV validation#39404amitb0ra wants to merge 4 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 11a018d The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ 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). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (8)📓 Common learnings📚 Learning: 2026-02-24T19:09:01.522ZApplied to files:
📚 Learning: 2026-01-17T01:51:47.764ZApplied to files:
📚 Learning: 2026-02-25T20:10:16.987ZApplied to files:
📚 Learning: 2025-11-24T17:08:17.065ZApplied to files:
📚 Learning: 2026-02-23T17:53:06.802ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
🔇 Additional comments (5)
WalkthroughMigrates the banners GET endpoint to an OpenAPI-compatible route: adds AJV validation for query parameters, defines explicit response schemas and standardized error responses, augments rest-typings with the new endpoint types, and updates tests to reflect changed validation error types. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
ahmed-n-abdeltwab
left a comment
There was a problem hiding this comment.
same as this one #39353
|
closing as handled in #39265 |
Proposed changes
Migrate the
bannersGET endpoint to the new OpenAPI-compatible route definition syntax with AJV query and response validation.Changes
apps/meteor/app/api/server/v1/banners.tsbannersfromaddRoute()toAPI.v1.get()withasync function action()handlerplatformasenum: ['web', 'mobile']200,400,401)type: 'object'forIBanner[]items (IBanneris not registered in typia due toz.custom<UiKit.BannerView>dependency)ExtractRoutesFromAPIanddeclare moduleaugmentation for automatic type extractionpackages/rest-typings/src/v1/banners.tsBannerstype and/v1/bannersendpoint entry fromBannersEndpointsisBannersPropsto compile againstBannersId(shared schema, same shape)BannersId,BannersDismiss, and their validators (still used by non-migrated endpoints)apps/meteor/tests/end-to-end/api/banners.ts[/banners]tests from'invalid-params'to'error-invalid-params'to match new typed route validation behavior.changeset/migrate-banners-openapi.md@rocket.chat/meteorand@rocket.chat/rest-typingsIssue(s)
Tracking: RocketChat/Rocket.Chat-Open-API#150
Test results
Summary by CodeRabbit