diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache index 96e1e1142ad7..0b35bbbc7c63 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache @@ -73,9 +73,6 @@ update_params_for_auth! header_params, query_params, opts[:auth_names] req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, :params_encoding => @config.params_encoding, :timeout => @config.timeout, :verbose => @config.debugging @@ -83,13 +80,13 @@ if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body if @config.debugging @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" end end request.headers = header_params request.body = req_body + request.options = OpenStruct.new(req_opts) request.url url request.params = query_params download_file(request) if opts[:return_type] == 'File' diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache index 26d324489b9d..2d779e04790d 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache @@ -110,7 +110,6 @@ module {{moduleName}} @server_operation_variables = {} @api_key = {} @api_key_prefix = {} - @timeout = 0 @client_side_validation = true {{#isFaraday}} @ssl_verify = true @@ -118,6 +117,7 @@ module {{moduleName}} @ssl_ca_file = nil @ssl_client_cert = nil @ssl_client_key = nil + @timeout = 60 {{/isFaraday}} {{^isFaraday}} @verify_ssl = true @@ -125,6 +125,7 @@ module {{moduleName}} @params_encoding = nil @cert_file = nil @key_file = nil + @timeout = 0 {{/isFaraday}} @debugging = false @inject_format = false diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index c2e65aa104c8..0faad1f70222 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -117,9 +117,6 @@ module Petstore update_params_for_auth! header_params, query_params, opts[:auth_names] req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, :params_encoding => @config.params_encoding, :timeout => @config.timeout, :verbose => @config.debugging @@ -127,13 +124,13 @@ module Petstore if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body if @config.debugging @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" end end request.headers = header_params request.body = req_body + request.options = OpenStruct.new(req_opts) request.url url request.params = query_params download_file(request) if opts[:return_type] == 'File' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index a8f4570e56e1..27a6c4270da1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -142,13 +142,13 @@ module Petstore @server_operation_variables = {} @api_key = {} @api_key_prefix = {} - @timeout = 0 @client_side_validation = true @ssl_verify = true @ssl_verify_mode = nil @ssl_ca_file = nil @ssl_client_cert = nil @ssl_client_key = nil + @timeout = 60 @debugging = false @inject_format = false @force_ending_format = false