Request Body
Set the schema field within the content object of the desired media type (e.g., 'application/json').
Responses
Set the schema field within the content object of the response status code. You can also define response headers using the headers key with a Zod schema.
// Request Body
createDocument({
paths: {
'/jobs': {
get: {
requestBody: {
content: {
'application/json': { schema: z.object({ a: z.string() }) },
},
},
},
},
},
});
// Responses with Headers
createDocument({
paths: {
'/jobs': {
get: {
responses: {
200: {
description: '200 OK',
content: {
'application/json': { schema: z.object({ a: z.string() }) },
},
headers: z.object({
'header-key': z.string(),
}),
},
},
},
},
},
});