-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
string “NULL” in Query will treated as nil in STD router StructReq #3465
Comments
@gqcn 底层调用了gconv.Strings()方法,如果参数是string的话,会调用json.Valid方法,然后传的null值字符串,会返回一个nil |
@gqcn The bottom layer calls the gconv.Strings() method. If the parameter is a string, the json.Valid method will be called, and then the null value string passed will return a nil |
if |
…is nil after the string is converted to []string
What version of
Go
and system type/arch are you using?go version go1.22.0 linux/amd64
What version of
GoFrame
are you using?v2.7.0
Can this bug be re-produced with the latest release?
YES
What did you do?
define a STD router REQ
test with this REQs
GET /test?es[]=NULL
result inNULLStringReq.ES = []string{"NULL"}
GET /test?es=1
result inNULLStringReq.ES = []string{"1"}
GET /test?es=NULL
result inNULLStringReq.ES = nil
What did you expect to see?
GET /test?es=NULL
result inNULLStringReq.ES = []string{"NULL"}
just like
GET /test?es=1
or like the raw method,which is correctWhat did you see instead?
The text was updated successfully, but these errors were encountered: