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

Improve form support #144

Closed blomqma closed 5 months ago

blomqma commented 5 months ago

This adds support for strongly-typed form data using the zod-form-data schema that are now supported alongside regular Zod schemas.

Pages router router routes now support validating and strongly typing form data requests that have the application/x-www-form-urlencoded, whereas app router routes also support strongly typed multipart/form-data requests using the req.formData() method from the NextRequest object.

Because RPC routes share the common rpcOperation method for both pages and app router, strongly typed form data is for now only supported with the application/x-www-form-urlencoded content type.

vercel[bot] commented 5 months 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 Mar 24, 2024 1:22pm
next-rest-framework-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2024 1:22pm