validator
validator copied to clipboard
"Or" operator: err.Tag() contain all tag around "|"
- [x] I have looked at the documentation here first?
- [x] I have looked at the examples provided that may showcase my question here?
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
when I use Or Operator ,
err.Tag() contain all tag around |
Code sample, to showcase or reproduce:
type someStruct struct {
//...
SortOrder *int `json:"sortOrder" db:"sort_order" validate:"omitempty,gte=10|lte=-1"`
//...
}
err := Validator.Struct(form)
// err.Tag() = "gte=10|lte=-1"
Expected only one tag, which trigger error
also err.Param() contain alwais last value regardless order of tag