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
@jogiranjith Probably you need to access other value from http.request. But at this point (v1.9) we don't have any request object inside AddCustomRule.
We can pass the request object to custom rules for further manipulation, but we can't do this change on patch, because it'll change API and break others code. Hope, we will be able to pass the request object to the AddCustomRule for v2.0.
Note: But there is a tricky way to solve your problem, you can check the dates manually after the other validation:
v := govalidator.New(opts)
e := v.Validate()
if startDate > endDate {
e.Add("start_date", "Start date can not be greater than end date") // this will add the error message to the validation errors
e.Add("end_date", "Start date can not be greater than end date")
}
As 2.0 will be our next major release, you may have to wait a little time :)
No description provided.
The text was updated successfully, but these errors were encountered: