Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the $value placeholder is not replaced in validation error messages #921

Open
waji-io opened this issue Feb 18, 2021 · 1 comment
Open
Labels
status: fixed Issues with merged PRs, but not released yet. type: fix Issues describing a broken feature.

Comments

@waji-io
Copy link

waji-io commented Feb 18, 2021

Description

When triggered a validation error, the resulting error message with the variable $value shows the variable name instead of the actual value. Other ValidationError variables still work, like $property or $contraint1

Minimal code-snippet showcasing the problem

@Max(250, { message: '$property is too big. Maximum value is $constraint1, but actual is $value' })
limit: number = 100;

Expected behavior

Show the actual value of $value and not its name.

Actual behavior

Instead of seeing the following validation error message:

"limit is too big. Maximum value is 250, but actual is 500"

I am seeing this:

"limit is too big. Maximum value is 250, but actual is $value"

Version used

0.13.1

@waji-io waji-io added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Feb 18, 2021
@c0d3ster
Copy link

duplicated here: #1046
Has anyone dug into this one and found the issue? I'm experiencing this on validating a nested object input type

@NoNameProvided NoNameProvided added status: has PR Issues which has a related PR closing the issue. and removed status: needs triage Issues which needs to be reproduced to be verified report. labels Dec 9, 2022
@NoNameProvided NoNameProvided changed the title ValidationError - Value of $value is not shown in validation error message fix: the $value placeholder is not replaced in validation error messages Dec 9, 2022
@NoNameProvided NoNameProvided added status: fixed Issues with merged PRs, but not released yet. and removed status: has PR Issues which has a related PR closing the issue. labels Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: fixed Issues with merged PRs, but not released yet. type: fix Issues describing a broken feature.
Development

No branches or pull requests

3 participants