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 a32b6ab6a8a2..4eed519e144a 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 @@ -12,6 +12,7 @@ } connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| + conn.proxy = config.proxy if config.proxy conn.request(:basic_auth, config.username, config.password) @config.configure_middleware(conn) if opts[:header_params]["Content-Type"] == "multipart/form-data" @@ -62,7 +63,7 @@ # @option opts [Hash] :query_params Query parameters # @option opts [Hash] :form_params Query parameters # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request + # @return [Faraday::Request] A Faraday Request def build_request(http_method, path, request, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase @@ -73,12 +74,6 @@ update_params_for_auth! header_params, query_params, opts[:auth_names] - req_opts = { - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) if @config.debugging @@ -87,7 +82,12 @@ end request.headers = header_params request.body = req_body - request.options = OpenStruct.new(req_opts) + + # Overload default options only if provided + request.options.params_encoding = @config.params_encoding if @config.params_encoding + request.options.timeout = @config.timeout if @config.timeout + request.options.verbose = @config.debugging if @config.debugging + 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_tls_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache index e5f4085cda24..598186a7f930 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache @@ -27,3 +27,7 @@ ### TLS/SSL setting # Client private key file (for client certificate) attr_accessor :ssl_client_key + + ### Proxy setting + # HTTP Proxy settings + attr_accessor :proxy diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/package-lock.json b/samples/client/petstore/typescript-angular-v11-provided-in-root/package-lock.json index 808ca6bb24c6..e0ec5088b89c 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/package-lock.json +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/package-lock.json @@ -5824,9 +5824,9 @@ "dev": true }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "http-deceiver": { @@ -7603,7 +7603,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, @@ -7725,7 +7725,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -11265,7 +11265,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }