[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
When using ValidateNested
from class-validator
to validate a nested object on a dto, the validation passes successfully with invalid nested objects.
When using ValidateNested
to validate a nested object on a dto, the validation should fail with validation rules.
https://gist.github.com/chimon2000/d2203b281bbaea570eeccb36ebd6de9b
N/A
Nest version: 4.6.4
For Tooling issues:
- Node version: v8.9.4
- Platform: Windows
Others:
N/A
@ValidateNested()
@Type(() => AddressDto) // add this from class-transformer
readonly address: AddressDto
That resolved my issue. Thanks!
Is it possible to reopen this issue? I'm currently experiencing this, and unfortunately @chanlito's solution doesn't do the trick.
If @chanlito solution does not work try using @IsNotEmpty() to the parent property, like this:
@IsNotEmpty()
delivery: Delivery;
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment