Go Struct and Field validation, including Cross Field and Cross Field Cross Struct validation
@all Guys u have this below struct
type PropertyMessage struct {
id string `form:"id" json:"id" binding:"required"`
data []map[string]interface{} `form:"data" json:"data" binding:"required" validate:"gt=0"`
}
Seems like gt
is not working when my POST request payload is
{
id: "abc",
data: []
}
Value *big.Int json:"value" binding:"required,min=1000000000000000"
// does not work
json:"email"
json:"phone"
json:"password"
context.Context
and then use one of the validation functions that accept it eg. validate.StructCtx
, but that's if it's dynamic, if looking to embed static logic from the application see here for an example go-playground/validator#462