httpx.Parse returns 500 error if all arguments have defaults and no value submitted
Cwt-ting opened this issue · comments
Cwt-ting commented
Describe the bug
提交参数只有2个可选时,2个参数都不传的情况下 会报 httpx.Parse 500 解析错误
To Reproduce
Steps to reproduce the behavior, if applicable:
-
The code is
var req types.ApplyFriendsListReq if err := httpx.Parse(r, &req); err != nil { httpx.Error(w, err) return }
-
The error is
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environments (please complete the following information):**
- OS: [e.g. Linux]
- go-zero version [e.g. 1.2.1]
- goctl version [e.g. 1.2.1, optional]
**More description**
Add any other context about the problem here.
Kevin Wan commented
I cannot reproduce this issue, check the code here: https://github.com/kevwan/zero-issues/tree/main/1197
Cwt-ting commented