Description

How to delay validation until all binding done ??

Such as when It run ShouldBindUri, It will return an error cause by a field which shoud be binded from query.

How to reproduce

type GetReq struct {
    Name    string `uri:"name" binding:"required"`
    Version int    `form:"version"`
}
// obj *GetReq
c.ShouldBindUri(obj) // return error
c.ShouldBindQuery(obj)

It will return an error cause by a field which shoud be binded from query.

Environment

  • go version: 1.18
  • gin version (or commit ref): 1.7.7
  • operating system: Windows11