-
Couldn't load subscription status.
- Fork 839
Closed
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: featureIssues related to new features.Issues related to new features.
Description
If i apply the following annotations:
@IsNotEmpty()
@IsInt()
@Min(0)
foobar: number;The validation result will be:
{
"value": null,
"property": "foobar",
"children": [],
"constraints": {
"min": "foobar must be greater than 0",
"isInt": "foobar must be an integer number",
"isNotEmpty": "foobar should not be empty"
}
}If no value is given (i.e.: foobar === null), I only want the validation result of @IsNotEmpty.
All the others are quite useless... worse: since the validation errors (the constraints) are stored in an object, the ordering is lost so I cannot "just take the first error constraint" :(
Expected result:
{
"value": null,
"property": "foobar",
"children": [],
"constraints": {
"isNotEmpty": "foobar should not be empty"
}
}
or:
{
"value": null,
"property": "foobar",
"children": [],
"constraints": [
{"isNotEmpty": "foobar should not be empty" },
{"isInt": "foobar must be an integer number"},
{ "min": "foobar must be greater than 0"}
]
}
mathiasvr, websolutions-hamburg, MichalLytek, reinoute, KoalaHuman and 20 more
Metadata
Metadata
Assignees
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: featureIssues related to new features.Issues related to new features.