feat(router): support Typebox schema validation#48
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughTypeBox schema validation support is integrated into the endpoint router: peer dependency added, ChangesTypeBox Schema Support Integration
Sequence DiagramsequenceDiagram
participant Client
participant createEndpoint as createEndpoint()
participant UnwrapSchema as UnwrapSchema
participant createValidator as createValidator()
participant Check as TypeBox Check()
participant Handler as Request Handler
Client->>createEndpoint: request + TObject schemas
createEndpoint->>UnwrapSchema: infer types from TObject
UnwrapSchema-->>createEndpoint: Static<TObject> types
createEndpoint->>createValidator: register TObject schemas
createValidator->>Check: IsObject(schema)?
Check-->>createValidator: recognized TypeBox schema
Client->>Handler: request body/params/searchParams
Handler->>Check: Check(schema, data)
Check-->>Handler: valid or validation_error
Handler-->>Client: success or 422 Unprocessable Entity
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Description
This pull request adds ArkType schema validation support alongside the existing Zod, Valibot and Arktype integrations.
Aura Router now supports three schema validation libraries for endpoint validation across:
Changes
Usage
Summary by CodeRabbit
New Features
Tests