Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. (+1 squashed commit) Squashed commits: [5e4cf8d] Improve form support 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.
- Loading branch information