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

升级1.7.4版本后,optional可选参数修饰符不生效,所有数字类型的字段,在传递空值时报错 #4579

Closed
mowocc opened this issue Jan 17, 2025 · 2 comments

Comments

@mowocc
Copy link

mowocc commented Jan 17, 2025

升级1.7.4版本后,optional可选参数修饰符不生效,所有数字类型的字段,在传递空值时报错。

比如以下结构体:

type UserInfoRequest struct {
	UserId  int32 `form:"user_id,optional"`
}

当请求参数传递了user_id 字段,但该字段值为空,会触发以下报错:

strconv.ParseInt: parsing "": invalid syntax

请官方查看一下该问题

@kevwan
Copy link
Contributor

kevwan commented Jan 17, 2025

Duplidate #4578

@kevwan kevwan closed this as completed Jan 17, 2025
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Duplidate #4578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants