fix: Special token $value
Description
$value token does not get replaced on validation.
@Max(120, {
message:
"Maximum $property is $constraint1. $target can't be $value years old",
})
Expected behavior
$value should be replaced with whatever the user has passed as an argument on the request
{
"statusCode": 400,
"message": [
"Maximum age is 120. User can't be 122 years old"
],
"error": "Bad Request"
}
Actual behavior
This clearly doesn't work and the response contains '$value' as string
{
"statusCode": 400,
"message": [
"Maximum age is 120. User can't be $value years old"
],
"error": "Bad Request"
}
Do we have any updates on this one? Am I missing something?
experiencing the same
It only works for string value.
And it was actually fixed half a year ago in this commit: https://github.com/typestack/class-validator/commit/d325cc7c45bffc45ce8b328bddc43f4e814fbe6b#diff-c5095b550c2b7842df845f7666600b194bdc62e369fecec22efc84ddab6fba38
But this fix is not in the master branch yet.
Waiting for an update on this