fix: validation of missing properties in helpers.forEach
#1228
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.
Summary
Describe what your PR does in a few short words
validations on properties inside
helpers.forEach
that were missing in the target model were skipped(I think there are several issues referencing this... I'm just fixing it because I need to deal with it in an app that I'm maintaining. Please get this merged so I can unpin my modified version of
vuelidate
from my repo.)Here's a simple reproduction:
Running the above code, you will notice that
vuelidate
incorrectly does not report errors for the second object in the array.Metadata
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The validation result does change a tiny bit, see the diff in the test. Properties without validators are now omitted from the validation result instead of appearing empty. I assume this change may possibly break a consumer app with very specific implementations of how they read the validation result from the
forEach
. I've decided to ignore this possibly breaking change, since it seems inherently counter intuitive that properties without validators appear in the validation result and that is different behavior to how it normally behaves outside of theforEach
function. Any implementation that leans on this behavior must be doing it for no particular good reason, only a quirk they've had to accomodate for in the past.