OpenAPITools / OpenAPITools/openapi-generator

[REQ][Ruby] Ruby Allow Follow Redirect

Open
#10,028 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

Currently generated Ruby client is using Typhoeus::Request with "followlocation" not set so all requests which get redirected will fail

Describe the solution you'd like

Add :followlocation => true to the req_opts inside function build_request

req_opts = {
:method => http_method,
:headers => header_params,
:params => query_params,
:params_encoding => @config.params_encoding,
:timeout => @config.timeout,
:ssl_verifypeer => @config.verify_ssl,
:ssl_verifyhost => _verify_ssl_host,
:sslcert => @config.cert_file,
:sslkey => @config.key_file,
:verbose => @config.debugging,
:followlocation => true,
}

I think this should be turned on by default to allow API redirect users etc. Hope this will be available in the coming updates.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the generated Ruby client's build_request function and inspect how req_opts is assembled for Typhoeus::Request. Enable followlocation there, then verify that requests receiving redirects are followed as intended. The issue does not name a file or test, so identify the relevant generated-client test coverage before making the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.