Merge branch 'bug-fix-ruby-file-upload' into ruby-api-client

Conflicts:
	modules/swagger-codegen/src/main/resources/ruby/swagger/request.mustache
	samples/client/petstore/ruby/lib/petstore/swagger/request.rb
This commit is contained in:
xhh
2015-08-20 11:24:33 +08:00
6 changed files with 18 additions and 4 deletions

View File

@@ -290,7 +290,8 @@ module {{moduleName}}
def build_request_body(header_params, form_params, body)
# http form
if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
header_params['Content-Type'] == 'multipart/form-data'
data = form_params.dup
data.each do |key, value|
data[key] = value.to_s if value && !value.is_a?(File)