forked from typestack/class-validator
-
Notifications
You must be signed in to change notification settings - Fork 9
fix: allow numbers and booleans as validation message "$value" tokens #71
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
Open
kffl
wants to merge
101
commits into
nestjs:master
Choose a base branch
from
kffl:nest-master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chore(deps): pin dependencies
chore(deps): update dependency @types/node to v14.17.32
…-11.x chore(deps): update dependency @rollup/plugin-node-resolve to v11.2.1
chore(deps): update dependency lint-staged to v10.5.4
chore(deps): update dependency husky to v4.3.8
chore(deps): update dependency eslint to v7.32.0
chore(deps): update dependency rollup to v2.58.3
chore(deps): update dependency eslint-plugin-jest to v24.7.0
chore(deps): update dependency ts-jest to v26.5.6
chore(deps): update dependency validator to 13.7.0 [security]
Corrected npm install command - package name
Update README.md
Match file contents with the nestjs/nest/.github/PULL_REQUEST_TEMPLATE.md
style: update PR template markdown file
7b454dd
to
5f0d424
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The
$value
token placed in the validation message is parsed as expected only when the provided value is of type string, which results in commonly used validators with non-string values such as@MinLength
,@Min
,@MaxLength
,@Max
ect. leaving the $value token in the validation message without replacing it. This PR relaxes the runtime typecheck performed when constructing the validation message by allowing types boolean and number (alongside string) to act as $value token replacements.Documented in issues: typestack#921, typestack#1046, also reported in the NestJS repo as nestjs/nest#6431
What is the new behavior?
As documented in README examples -
$value
tokens will be replaced in the validation error message even if the underlying value is a number or a boolean.Does this PR introduce a breaking change?
Other information
Thanks for taking the time to create this fork. I have opened a PR with the same changes against the original repo, but given its rather stale maintenance status I thought that I might as well do it here.
I have also fixed formatting of the PR template file which was causing the CI pipeline to fail.