Skip to content

Commit 7b1795a

Browse files
authored
[REQ][Ruby] Ruby Allow Follow Redirect (#12047)
* Add `follow_location` option Implementation of #10028 * regenerated clients
1 parent f195a83 commit 7b1795a

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
header_params = @default_headers.merge(opts[:header_params] || {})
5050
query_params = opts[:query_params] || {}
5151
form_params = opts[:form_params] || {}
52+
follow_location = opts[:follow_location] || false
5253

5354
{{#hasAuthMethods}}
5455
update_params_for_auth! header_params, query_params, opts[:auth_names]
@@ -67,7 +68,8 @@
6768
:ssl_verifyhost => _verify_ssl_host,
6869
:sslcert => @config.cert_file,
6970
:sslkey => @config.key_file,
70-
:verbose => @config.debugging
71+
:verbose => @config.debugging,
72+
:followlocation => follow_location
7173
}
7274

7375
# set custom cert, if provided

samples/client/petstore/ruby/lib/petstore/api_client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def build_request(http_method, path, opts = {})
9393
header_params = @default_headers.merge(opts[:header_params] || {})
9494
query_params = opts[:query_params] || {}
9595
form_params = opts[:form_params] || {}
96+
follow_location = opts[:follow_location] || false
9697

9798
update_params_for_auth! header_params, query_params, opts[:auth_names]
9899

@@ -109,7 +110,8 @@ def build_request(http_method, path, opts = {})
109110
:ssl_verifyhost => _verify_ssl_host,
110111
:sslcert => @config.cert_file,
111112
:sslkey => @config.key_file,
112-
:verbose => @config.debugging
113+
:verbose => @config.debugging,
114+
:followlocation => follow_location
113115
}
114116

115117
# set custom cert, if provided

samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def build_request(http_method, path, opts = {})
9393
header_params = @default_headers.merge(opts[:header_params] || {})
9494
query_params = opts[:query_params] || {}
9595
form_params = opts[:form_params] || {}
96+
follow_location = opts[:follow_location] || false
9697

9798
update_params_for_auth! header_params, query_params, opts[:auth_names]
9899

@@ -109,7 +110,8 @@ def build_request(http_method, path, opts = {})
109110
:ssl_verifyhost => _verify_ssl_host,
110111
:sslcert => @config.cert_file,
111112
:sslkey => @config.key_file,
112-
:verbose => @config.debugging
113+
:verbose => @config.debugging,
114+
:followlocation => follow_location
113115
}
114116

115117
# set custom cert, if provided

samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def build_request(http_method, path, opts = {})
9393
header_params = @default_headers.merge(opts[:header_params] || {})
9494
query_params = opts[:query_params] || {}
9595
form_params = opts[:form_params] || {}
96+
follow_location = opts[:follow_location] || false
9697

9798

9899
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
@@ -108,7 +109,8 @@ def build_request(http_method, path, opts = {})
108109
:ssl_verifyhost => _verify_ssl_host,
109110
:sslcert => @config.cert_file,
110111
:sslkey => @config.key_file,
111-
:verbose => @config.debugging
112+
:verbose => @config.debugging,
113+
:followlocation => follow_location
112114
}
113115

114116
# set custom cert, if provided

samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def build_request(http_method, path, opts = {})
9393
header_params = @default_headers.merge(opts[:header_params] || {})
9494
query_params = opts[:query_params] || {}
9595
form_params = opts[:form_params] || {}
96+
follow_location = opts[:follow_location] || false
9697

9798

9899
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
@@ -108,7 +109,8 @@ def build_request(http_method, path, opts = {})
108109
:ssl_verifyhost => _verify_ssl_host,
109110
:sslcert => @config.cert_file,
110111
:sslkey => @config.key_file,
111-
:verbose => @config.debugging
112+
:verbose => @config.debugging,
113+
:followlocation => follow_location
112114
}
113115

114116
# set custom cert, if provided

0 commit comments

Comments
 (0)