blomqma / next-rest-framework

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

Input params validation not returning http status 400 #151

Closed jameslshannon closed 4 months ago

jameslshannon commented 4 months ago

I'm guessing this is because the Input path params validator is a relatively new addition, but any params validation errors are not currently resulting in an http 400 being returned (resulting in a misleading http 500 error instead). I can see body & query validation returning 400s in the code but not params.

blomqma commented 4 months ago

Thanks, support for this is now added in v6.0.0-beta.2, path parameters not conforming to the specified Zod schema will now return an error response and the Zod transforms etc. are also supported so that the parsed values can be accessed in the route handler like with query parameters 👍🏻