Closed colinricardo closed 5 months ago
how can i add a schema for the data on an incoming post request?
it doesnt seem to just accept a z.object()
e.g.
registry.registerPath({ method: "post", path: "/whatever", description: "Do something.", requestBody: { // what goes here? }, responses: { 200: { description: "Object with user data.", content: { "application/json": { schema: $MySchema, }, }, }, }, })
@colinricardo the correct place to use this would be inside the request.body property instead. Iti s mentioned in this section https://nextjs.org/docs/app/building-your-application/routing/route-handlers
request.body
how can i add a schema for the data on an incoming post request?
it doesnt seem to just accept a z.object()
e.g.