Open tunhuit opened 3 years ago
I want to bind URI params and JSON payload in the same struct, How can I do this?
type UpdateRequest struct { ID uint64 `uri:"id" binding:"required"` Data struct { Name string `json:"name" binding:"required"` Slug string `json:"slug" binding:"required"` } }
`
var params UpdateRequest c.ShouldBindUri(¶ms) c.ShouldBindJSON(¶ms.Data)
Related PR: https://github.com/gin-gonic/gin/pull/2812
I want to bind URI params and JSON payload in the same struct, How can I do this?