Skip to content

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

Open
@waji-io

Description

@waji-io

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: fixedIssues with merged PRs, but not released yet.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions