However, when you do this together with this library, that results in a error:
"err": {
"type": "Error",
"message": "Invalid schema passed: {\"type\":\"null\",\"description\":\"No Content\"}",
"stack": "Error: Invalid schema passed: {\"type\":\"null\",\"description\":\"No Content\"}
at resolveSchema (--\\node_modules\\fastify-type-provider-zod\\dist\\index.js:116:11)
at Object.transform (--\\node_modules\\fastify-type-provider-zod\\dist\\index.js:72:32)
at Object.swagger (--\\node_modules\\@fastify\\swagger\\lib\\spec\\openapi\\index.js:36:21)
at fastify.route.handler (--\\node_modules\\@fastify\\swagger-ui\\lib\\routes.js:175:28)
at preHandlerCallback (--\\node_modules\\fastify\\lib\\handleRequest.js:137:37)
at validationCompleted (--\\node_modules\\fastify\\lib\\handleRequest.js:121:5)
at preValidationCallback (--\\node_modules\\fastify\\lib\\handleRequest.js:98:5)
at handler (--\\node_modules\\fastify\\lib\\handleRequest.js:75:7)
at handleRequest (--\\node_modules\\fastify\\lib\\handleRequest.js:24:5)
at runPreParsing (--\\node_modules\\fastify\\lib\\route.js:593:5)"
}
How to achieve this with zod? I've tried z.undefined(), but that is not resulting in an empty content.
Or is this just a bug at this moment?
Currently, fastify-swagger allows the specification of a 204 without any content:
https://github.com/fastify/fastify-swagger?tab=readme-ov-file#empty-body-responses
However, when you do this together with this library, that results in a error:
How to achieve this with zod? I've tried z.undefined(), but that is not resulting in an empty content. Or is this just a bug at this moment?