Open alexdee2007 opened 11 months ago
Hi, I've also faced this problem, but it appear when using schema.validate
function, but not in schema.validateAt
.
validationError.path
has format TupleArray["0"]
instead of TupleArray[0]
.
Hi, I've also faced this problem, but it appear when using
schema.validate
function, but not inschema.validateAt
.validationError.path
has formatTupleArray["0"]
instead ofTupleArray[0]
.
Hi, yes it is. I'm using schema.validate
. I had to write something like this to make the application work correctly.
error.path = error.path?.replace(/\["([0-9]+)"\]/g, '[$1]');
https://github.com/jquense/yup/blob/5db2b2fdd6276ff8ae8c15e8aa9d3aa9710ad4ac/src/schema.ts#L549
Hi! Thanks for the wonderful library. I was sorting out some collisions in my application and noticed this. This implementation leads to the fact that when validating a tuple array, if the element of the array is not defined or is null, the index of the array in the path becomes a string, for example
TupleArray["1"]
instead ofTupleArray[1]
.