forked from loafle/openapi-generator-original
Replace use of deprecated Faraday::UploadIO (#13127)
Faraday 0.16.0 added Faraday::FilePart as an alias to Faraday::UploadIO
and deprecated Faraday::UploadIO. In Faraday 2.0 the deprecated UploadIO
was removed.
Fixes: e12100b033
This commit is contained in:
committed by
GitHub
parent
c987e75f92
commit
9abaa53db1
@@ -90,7 +90,7 @@
|
||||
case value
|
||||
when ::File, ::Tempfile
|
||||
# TODO hardcode to application/octet-stream, need better way to detect content type
|
||||
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
||||
data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
|
||||
when ::Array, nil
|
||||
# let Faraday handle Array and nil parameters
|
||||
data[key] = value
|
||||
|
||||
@@ -135,7 +135,7 @@ module Petstore
|
||||
case value
|
||||
when ::File, ::Tempfile
|
||||
# TODO hardcode to application/octet-stream, need better way to detect content type
|
||||
data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
|
||||
data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path)
|
||||
when ::Array, nil
|
||||
# let Faraday handle Array and nil parameters
|
||||
data[key] = value
|
||||
|
||||
Reference in New Issue
Block a user