func bsonValidator(v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool {
	return bson.IsObjectIdHex(field.String())
}
Is the ID is a valid bson hex ?
package api
import (
	"encoding/json"
	"net/http"
	"reflect"
	"gopkg.in/go-playground/validator.v8"
	"gopkg.in/mgo.v2/bson"
	"github.com/gorilla/schema"
	"github.com/leebenson/conform"
)
var (
	validate *validator.Validate
)
func init() {
	config := &validator.Config{TagName: "validate"}
	validate = validator.New(config)
	validate.RegisterValidation("bson", bsonValidator)
}