Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #12074
Closed
Open
Issue created Apr 07, 2022 by Administrator@rootContributor

[REQ][Ruby] Add support for faraday 2.x

Created by: ykitamura-mdsol

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

Faraday 2.x is released: https://github.com/lostisland/faraday/discussions/1358

Describe the solution you'd like

Based on the UPGRADING guide, we need to make changes to the following files:

gemspec.mustache

Relax Faraday dependency and add s.add_runtime_dependency 'faraday-multipart'

https://github.com/OpenAPITools/openapi-generator/blob/510f79989a003d2c81e6960ef09e8ba3ee43843d/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache#L22-L24

api_client.mustache

Add require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')

https://github.com/OpenAPITools/openapi-generator/blob/510f79989a003d2c81e6960ef09e8ba3ee43843d/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache#L13-L15

api_client_faraday_partial.mustache

Handle basic_auth like this to support both Faraday 1.x and 2.x.

https://github.com/OpenAPITools/openapi-generator/blob/510f79989a003d2c81e6960ef09e8ba3ee43843d/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache#L16

I'm going to work on this if no one has already started.

Assignee
Assign to
Time tracking