-
-
Notifications
You must be signed in to change notification settings - Fork 12
chore: simplify api handler's generic typing #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis PR adds default generic type parameters across the API layer, enabling Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (3)packages/server/src/api/rpc/index.ts (2)
packages/server/src/api/rest/index.ts (2)
packages/server/src/types.ts (1)
⏰ 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). (4)
🔇 Additional comments (5)
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 |
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the generic typing of API handlers by adding default type parameters (= SchemaDef) to generic type constraints. This allows consumers to use these types without explicitly specifying the schema type parameter when the default is sufficient.
Key changes:
- Added default type parameter to base
ApiHandlerinterface - Added default type parameter to RPC handler class and options type
- Added default type parameter to REST handler class
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/server/src/types.ts | Added default type parameter to ApiHandler interface |
| packages/server/src/api/rpc/index.ts | Added default type parameter to RPCApiHandler class and RPCApiHandlerOptions type |
| packages/server/src/api/rest/index.ts | Added default type parameter to RestApiHandler class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary by CodeRabbit