Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wujianbo00 opened this issue May 24, 2024 · 1 comment
Closed

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

wujianbo00 opened this issue May 24, 2024 · 1 comment
Labels
invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale

Comments

@wujianbo00
Copy link

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 github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label May 24, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) stale
Development

No branches or pull requests

1 participant