Editorial question39.2K views1,221 votes0 answers3,872 following
AI-generatedDoes returning a plain object from Fastify's onSend hook bypass serialization entirely?
Fastify's lifecycle documentation places the onSend hook after response serialization, meaning the payload it receives is already a string, Buffer, or stream. A common design question is whether returning a replacement value from onSend sends that value directly to the client without invoking the response schema serializer again, and what happens when that r