You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Using faraday as network library, generated ruby client is not able to detect the mime file type when performing file upload as part of a multipart/form-data payload, but it's just using application/octet-stream. That's hardcoded and it's not even possible to change that via some parameter. Looking at the generated code, there is a TODO we'd like to fix:
when ::File, ::Tempfile# TODO hardcode to application/octet-stream, need better way to detect content typedata[key]=Faraday::FilePart.new(value.path,'application/octet-stream',value.path)
openapi-generator version
Issue found in version 7.2.0+ (haven't checked previous versions).
…#17851) (#17853)
* fix(ruby): Detect content-type in form-data file upload using faraday (#17851)
* Update samples
* Add needed dependency libmagic-dev into node 1 setup of Circle Parallel CI
* After merge/pull last master + regeneration of samples
…OpenAPITools#17851) (OpenAPITools#17853)
* fix(ruby): Detect content-type in form-data file upload using faraday (OpenAPITools#17851)
* Update samples
* Add needed dependency libmagic-dev into node 1 setup of Circle Parallel CI
* After merge/pull last master + regeneration of samples
Bug Report Checklist
Description
Using
faraday
as network library, generated ruby client is not able to detect the mime file type when performing file upload as part of amultipart/form-data
payload, but it's just usingapplication/octet-stream
. That's hardcoded and it's not even possible to change that via some parameter. Looking at the generated code, there is a TODO we'd like to fix:openapi-generator version
Issue found in version 7.2.0+ (haven't checked previous versions).
OpenAPI declaration file content or url
https://github.com/onfido/onfido-openapi-spec/blob/2f6f506977ecbb340b80c6d31a2dffcb3cedf2bb/generated/artifacts/openapi-yaml/openapi/openapi.yaml#L199-L222
Generation Details
Steps to reproduce
Logs:
For a jpg image, we'd have expected to have received
image/jpeg
in place ofapplication/octet-stream
.Related issues/PRs
N/A
Suggest a fix
Use
ruby-filemagic
gem to detect the content type (PR coming soon).The text was updated successfully, but these errors were encountered: