The next/server#NextRequest object to validate
The schema to validate the request against
The validated request body and query
InvalidBodyException Thrown if the body failed validation
InvalidQueryParametersException Thrown if the query parameters failed validation
Validate a Next.js API route request with Zod schemas for the query parameters, path parameters, and/or body.
The next/server#NextRequest object to validate
The NextRouteHandlerSegmentData object to validate path parameters against
The schema to validate the request against
The validated request body and query
InvalidBodyException Thrown if the body failed validation
InvalidQueryParametersException Thrown if the query parameters failed validation
InvalidPathParametersException Thrown if the path parameters failed validation
Validate a Next.js API route request with Zod schemas for the query parameters and/or body.