-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Support array field for Request DTO #4025
Comments
fixed by #4026 |
I found this PR flawed. see #4015 (comment) bug url example:
error parse
|
i will fix this tomorrow
Yang Shi
201-15 bridgeland dr south
R3Y 0E7
chentong ***@***.***>于2024年4月2日 周二00:00写道:
… fixed by #4026 <#4026>
I found this PR flawed. see #4015 (comment)
<#4015 (comment)>
bug url example:
"/a?name=hello&age=18&percent=3.4&statuses=try"
error parse statuses is nil, instead of []string{"try"}.
=== RUN TestParseForm
requests_test.go:31:
Error Trace: /Users/chentong/project/go/go-zero/rest/httpx/requests_test.go:31
Error: Expected nil, but got: &fmt.wrapError{msg:"fullName: `statuses`, error: `string: `try`, error: `invalid character 'y' in literal true (expecting 'u')``", err:(*fmt.wrapError)(0x14000098900)}
Test: TestParseForm
requests_test.go:35:
Error Trace: /Users/chentong/project/go/go-zero/rest/httpx/requests_test.go:35
Error: Not equal:
expected: []string{"try"}
actual : []string(nil)
Diff:
--- Expected
+++ Actual
@@ -1,4 +1,2 @@
-([]string) (len=1) {
- (string) (len=3) "try"
-}
+([]string) <nil>
Test: TestParseForm
--- FAIL: TestParseForm (0.00s)
预期:[]string{"try"}
实际:[]string(nil)
@shyandsy <https://github.com/shyandsy> @kevwan
<https://github.com/kevwan>
—
Reply to this email directly, view it on GitHub
<#4025 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIG7INHCMZGFIAM45JOYGTY3GADRAVCNFSM6AAAAABFMAYWOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZQGA2TIOBTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
this is the new pr for this issue, could you guys help to check? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
It supports array field object in the api specification right now, and it should be work in controller
unfortunately, it doesn't work because there is a tiny mass in httpx package. The form.Get method only return one string rather than string array
![image](https://private-user-images.githubusercontent.com/5271457/317607178-bd0e7ed0-6b92-46e5-8439-d783e386dfa7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4MTc5OTMsIm5iZiI6MTcxODgxNzY5MywicGF0aCI6Ii81MjcxNDU3LzMxNzYwNzE3OC1iZDBlN2VkMC02YjkyLTQ2ZTUtODQzOS1kNzgzZTM4NmRmYTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTlUMTcyMTMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjdkMjFhMWY0NWVkZjExYmRiNWVjZjE3Y2ExMGJjMTc1NWJmZTk3ZTA0NzhmMDY3MmNhMzI5MWY1NjlkN2NiNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.6__ATzO9Gq3-7coXaMgoj-l9d1nplP_yWUQd_dZ7QMo)
Describe the solution you'd like
A clear and concise description of what you want to happen.
we should not use the Get method directly if we wanna support array field..... btw, I am curiose why Go design the method like this. It make no sense....right?
Alternatively, I will access the map directly like what saying in the comment
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: