I have ValidateNested and just need the message from the constraint that caused the issue.
Current Code:
function retrieveValidationErrorMessage(err: ValidationError): string {
if (err.children && err.children.length > 0) {
return retrieveValidationErrorMessage(err.children[0]);
} else {
return Object.keys(err.constraints).map(key => err.constraints[key])[0];
}
}
You need to traverse down at the moment, but this part will be reworked in the future.
Still waiting for that future to come. Any hints on when will this be ready?
Any news about this?
Features in open-source project are like wizards: They are never late, nor they are early, they arrive precisely when they mean to.
Serious part: There is a lot of refactoring and this is a breaking change. First, those parts will be refactored which didn't break the API, and breaking changes will be grouped together.
Closing this for now, but this is on my radar.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
You need to traverse down at the moment, but this part will be reworked in the future.