cloudwego / hertz

Go HTTP framework with high-performance and strong-extensibility for building micro-services.
https://www.cloudwego.io
Apache License 2.0
5.04k stars 491 forks source link

BindAndValidate BindForm解析时间字符串为空 #1122

Closed wujianbo00 closed 2 months ago

wujianbo00 commented 2 months ago

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也是空的 }

github-actions[bot] commented 2 months ago

This issue has been marked as invalid question, please give more information by following the issue template. The issue will be closed in 1 days if no further activity occurs.