But when there is an actual parent, the error message states The values of <schema> does not match schema definition
{
"statusCode": 500,
"error": "Internal Server Error",
"message": "The value of '#/definitions/getUserByIdResponseSchema/properties/parent' does not match schema definition."
}
Is there any way to explicitly tell fastify-zod to safeParse the object?
I want the final response of the API to look something like this:
So the parent can be nullable, I define my schema like this:
When the parent is actually null, the response is like expected:
But when there is an actual parent, the error message states
The values of <schema> does not match schema definition
Is there any way to explicitly tell fastify-zod to safeParse the object?