Lately I'm breaking my head to debug POST and PUT requests where the HTTP 422 (Incorrect Input Format) error always occurs
In my project I'm using the GIN framework to do a JSON BIND from the front end. I needed to know what the structure attribute is that is not in the proper format.
How do I give a PRINT of validation errors?
I've tried the following:
func postPerson(c *gin.Context) {
var person models.Person
c.BindJSON(&person)
fmt.Print(c.Errors.Error())
}