We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
file
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
The openapi-generator spec does have an optional single file endpoint:
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/go/go-petstore/api/swagger.yaml
- name: "attachment" in: "formData" description: "File to upload" required: false type: "array" items: type: "file"
* @param "Attachment" (optional.Interface of []*os.File) - File to upload
type SendFaxMessageOpts struct { Attachment optional.Interface FaxResolution optional.String SendTime optional.Time IsoCode optional.String CoverIndex optional.Int32 CoverPageText optional.String }
if localVarOptionals != nil && localVarOptionals.Attachment.IsSet() { localVarFormParams.Add("attachment", parameterToString(localVarOptionals.Attachment.Value(), "csv")) }
./fax_send.go:130:21: cannot use files (type []*os.File) as type optional.Interface in assignment
- name: "attachment" in: "formData" description: "File to upload" required: false type: "file"
* @param "Attachment" (optional.Interface of *os.File) - File to upload
var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.Attachment.IsSet() { localVarFileOk := false localVarFile, localVarFileOk = localVarOptionals.Attachment.Value().(*os.File) if !localVarFileOk { return localVarReturnValue, nil, reportError("attachment should be *os.File") } } if localVarFile != nil { fbs, _ := ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() }
./fax_send.go:130:21: cannot use files[0] (type *os.File) as type optional.Interface in assignment
../../client/api_messages.go:633:131: undefined: os
After resolving the "os" import:
localVarFormParams.Add("attachment", parameterToString(attachment, "csv"))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The openapi-generator spec does have an optional single file endpoint:
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/go/go-petstore/api/swagger.yaml
Optional Array of Files
YAML spec
Generated Code
Runtime Error
Optional Single File
YAML Spec
Runtime Error
Required Array of Files
Compile time error
After resolving the "os" import:
The text was updated successfully, but these errors were encountered: