You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to apply validation rules to each item in a slice.
eg
type MyStruct struct {
Id int
MyNumbers []int `json:"my_numbers" binding:"range(1, 10)"`
}
The following should then fail validation as one of the items in the list is outside of the range.
{
"id": 1,
"my_numbers": [1,2,3,4,100]
}
This would require replacing MinSize and MaxSize from being applied to slice lengths, so that rules can instead be used for length of each item in a slice of strings. New rules specific to slice length would then need to be introduced.
The text was updated successfully, but these errors were encountered:
I would like to be able to apply validation rules to each item in a slice.
eg
The following should then fail validation as one of the items in the list is outside of the range.
This would require replacing MinSize and MaxSize from being applied to slice lengths, so that rules can instead be used for length of each item in a slice of strings. New rules specific to slice length would then need to be introduced.
The text was updated successfully, but these errors were encountered: