class-validator fails validation for IsDateString with 'must be ISOString but value logged is clearly an ISO String? class-validator fails validation for IsDateString with 'must be ISOString but value logged is clearly an ISO String? mongoose mongoose

class-validator fails validation for IsDateString with 'must be ISOString but value logged is clearly an ISO String?


What's being logged in the error is not the object itself and turns out that mongoose will convert the date strings to date objects. I ended up making the check on that property optional if the value is a date.