#ReturnsValidationError: Value does not match validator. Use validator like zod to validate value

5 messages · Page 1 of 1 (latest)

gaunt vigil
#

Hi, is it possible to check what exactly is different and unexpected from when getting a ReturnsValidationError? Currently my value and validator are huge and the error message doesn't specify what it expects and it's very difficult for me to find out what the discrepency is.

#

Here is the full error message, it's pretty massive because of my validator so I can't feasibly read it. I'd greatly appreciate if it was possible to find out what the validation error is specifically like how zod does.

mellow bloom
#

This would be tough to do, especially with unions. Would have to show expected/actual for every member of the union compared to your input somehow.

#

And yeah that's a massive validator. AI is your best bet for parsing out errors. This also probably points to some kind of type issue, are you asserting types anywhere?

humble spoke
#

if you store the value somewhere you could cut up the object and run the validate helper on each sub-union? Agreed the error messages here could use some love