Feature request: Use validator on dynamic nested maps
sabloger opened this issue ยท 1 comments
sabloger commented
Hi,
I want to validate nested maps with a mapped validate map!
example:
var mapTemplate = map[string]interface{}{
"name":"required,alpha",
"family":"required,alpha",
"email":"required,email",
"cell-phone":"numeric",
"address":map[string]interface{}{
"line1":"required,alphanum",
"line2":"alphanum",
"postal-code":"numeric",
},
}
var inputMap = map[string]interface{}{
"name":"Bob",
"family":"Smith",
"email":"foo@bar.baz",
"address":map[string]interface{}{
"line1":"",
"line2":"",
"postal-code":"",
},
}
func validate() {
govalidator.MapValidate(mapTemplate , inputMap)
}
sabloger commented
I need it to validate request inputs!