You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"statusCode": 500,
"code": "FST_ERR_FAILED_ERROR_SERIALIZATION",
"message": "Failed to serialize an error. Error: Response doesn't match the schema. Original error: Unauthorized"
}
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
Prerequisites
Fastify version
4.28.1
Plugin version
5.6.0
Node.js version
20.17.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.7.6
Description
I noticed that when I add .strict() schema validation in my response schemas (zod), reply.*() breaks.
Eg. reply.unauthorized() returns this response:
This fails:
With this error:
This works:
Link to code that reproduces the bug
No response
Expected Behavior
Should be possible to add strict validation.
The text was updated successfully, but these errors were encountered: