Closed woodsaj closed 9 years ago
Validating the structs within a slice is just an additional step of the validation process flow.
The existing logic, where the slice itself is subjected to validation is still in place. This is validated with the Unit Tests.
However, as per https://github.com/macaron-contrib/binding/issues/3, it would be great if we could create new validation rules for slices, SliceSize, SliceMinSize, SliceMaxSize, so that we could then apply the validation rules to the items in a slice. This would however, cause problems for users already relying on Size, MinSize and MaxSize for validating the number of items in a slice.
However, as per #3, it would be great if we could create new validation rules for slices, SliceSize, SliceMinSize, SliceMaxSize, so that we could then apply the validation rules to the items in a slice. This would however, cause problems for users already relying on Size, MinSize and MaxSize for validating the number of items in a slice.
Yes, what about using Item..
prefix for rules that validate slice items?
I guess that could be made to work.
To be clear, though this PR addresses https://github.com/macaron-contrib/binding/issues/2
Additional work would be needed to address https://github.com/macaron-contrib/binding/issues/3
I guess that could be made to work.
To be clear, though this PR addresses #2
Additional work would be needed to address #3
Thanks your clarification!
Merging... thanks again!
Thanks your PR!
I have a question here:
So how do you apply validation on slice itself now? Let's say,
MinSize
of a slice?