BindAndValidate BindForm解析时间字符串为空 #1122
Labels
invalid issue
invalid issue (not related to Hertz or described in document or not enough information provided)
stale
curl -X 'POST' 'http://localhost:8080/test' -H 'accept: application/json' -H 'Content-Type: application/x-www-form-urlencoded' -d 'birth=2024-01-01%2012%3A00%3A00'
代码示例
type MyTime time.Time
type ReqTime struct {
Birthday MyTime
json:"birth" form:"birth"
//MyTime已经重写UnmarshalJSON解析字符串}
func Test(ctx context.Context, c *app.RequestContext) {
var req ReqTime
c.BindAndValidate(&req) // v0.9.0 Birthday是空的。换成v0.6.2就正常了
c.BindForm(&req) // v0.9.0 Birthday也是空的
}
The text was updated successfully, but these errors were encountered: