fix: errors from @NestedValidation are assigned to the child instead of the parent when property is not a class instance #679
Labels
flag: BREAKING CHANGE
Issues containing a breaking change, requiring a major release.
status: done/released
Issue has been completed, no further action is needed.
type: fix
Issues describing a broken feature.
Description
When a property has a
@ValidateNested()
decorator and the validated data on the property is not an object or array the validation error incorrectly assigned to the children instead of the parent.Minimal code-snippet showcasing the problem
Expected behavior
I have expected the error for the
nestedWithPrimitiveValue
property to appear on the root object instead of children.Actual behavior
Currently the
validationErrors
will be the following structure:Observe how the
nestedValidation
constraint is applied to the children instead of the root object.The text was updated successfully, but these errors were encountered: