-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat. add support formData []file #1332
Conversation
Codecov ReportBase: 95.64% // Head: 95.64% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #1332 +/- ##
=======================================
Coverage 95.64% 95.64%
=======================================
Files 14 14
Lines 2871 2871
=======================================
Hits 2746 2746
Misses 70 70
Partials 55 55
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -226,7 +226,7 @@ func findInSlice(arr []string, target string) bool { | |||
} | |||
|
|||
func (operation *Operation) parseArrayParam(param *spec.Parameter, paramType, refType, objectType string) error { | |||
if !IsPrimitiveType(refType) { | |||
if !IsPrimitiveType(refType) && !(refType == "file" && paramType == "formData") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are cheating the validation because file
is not a data type in go.
What is the spec output if I define type file
as the following?
type file []string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this should work as it was provided in the example above but only for@consume x-www-form-urlencoded
or @consume application/x-www-form-urlencoded
.
A mix of in:formData
with in:Body
params should not be allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Describe the PR
add support formData multiple file
Relation issue
#866