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
Hello! NIce library, very comprehensive functions. I've tried but i got an error from example in Readme.
q2, _:=rqp.NewParse(r.URL.Query(), rqp.Validations{
"limit:required": rqp.MinMax(10, 100), // limit must present in the Query part and must be between 10 and 100 (default: Min(1))"sort": rqp.In("id", "name"), // sort could be or not in the query but if it is present it must be equal to "in" or "name""s": rqp.In("one", "two"), // filter: s - string and equal"id:int": nil, // filter: id is integer without additional validation"i:int": func(valueinterface{}) error { // filter: custom func for validatingifvalue.(int) >1&&value.(int) <10 {
returnnil
}
returnerrors.New("i: must be greater then 1 and lower then 10")
},
"email": nil,
"name": nil,
})
Hello! NIce library, very comprehensive functions. I've tried but i got an error from example in Readme.
URL looks like:
?sort=+name,-id&limit=10&id=1&i[eq]=5&s[eq]=one&email[like]=*tim*|name[like]=*tim*
Error:
s[eq]: filter not found
If i remove
s[eq]
parameter from url query, then i got an error:sort: validation not found
If i remove
sort
parameter from url query, then i got an error:id: filter not found
Can you tell what i'm doing wrong?
The text was updated successfully, but these errors were encountered: