1
Lately I’m breaking my head too much to debug the POST and PUT requests where HTTP 422 error always occurs (Incorrect input format)
In my project I am using the GIN framework to make a JSON BIND sent from the front end. I needed to know which attribute of the structure is not in the proper format.
How do I print the validation errors?
I tried the following:
func postPerson(c *gin.Context) {
var person models.Person
c.BindJSON(&person)
fmt.Print(c.Errors.Error())
}