blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
155 stars 20 forks source link

Fix query parameter validation on App Router #73

Closed blomqma closed 1 year ago

blomqma commented 1 year ago

This fixes the search query parameter validation when using App Router. The previous implementation that was ported from the Pages Router implementation, was validating the context parameter, used as part of the dynamic route parameters with App Router handlers. This fix makes sure that the query parameter validation is equivalent on both routers now. The typings for the request object on App Router are also updated now so that the typed query parameters can be accessed from req.nextUrl.search.

Co-authored-by: Mirko Budszuhn mirko314@users.noreply.github.com

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-rest-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2023 7:59pm
next-rest-framework-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2023 7:59pm