ozzo-validation
ozzo-validation copied to clipboard
showing '-' as field name in error for hidden fields
I'm validating a User struct whose password field is not exposed to the client. This is my user struct
type User struct {
Name string `json:"name" bson:"name"`
Email string `json:"email" bson:"email"`
Password string `json:"-" bson:"password"`
}
and when validation fails for Password field it returns error as:
{
"-": "the length must be between 8 and 18"
}
Is there any way so that i can pass field name to it ?