The Ruby OpenAPI generator currently defaults to using Typhoeus. While this is certainly a good choice for many applications, some may want to reuse HTTP clients that are already used in other parts of the application.
This can be achieved by using the Faraday gem. It basically provides an additional abstraction on top Ruby HTTP clients. This way it's possible to use any HTTP client that has an adapter implementation for Faraday. There also exists an adapter for Typhoeus, so people can continue using it.
The use cases for me are:
- Using existing HTTP clients (avoid installing Typhoeus if I'm already using HTTP.rb or httpx)
- Easy and streamlined configuration (things like logging are somewhat hard to configure with Typheous)
As far as I understand the only change needed would be to set the "library" option of the generator to "faraday" and to adjust the CI setup to install the according gem instead of Typhoeus. What do you think?
The Ruby OpenAPI generator currently defaults to using Typhoeus. While this is certainly a good choice for many applications, some may want to reuse HTTP clients that are already used in other parts of the application.
This can be achieved by using the Faraday gem. It basically provides an additional abstraction on top Ruby HTTP clients. This way it's possible to use any HTTP client that has an adapter implementation for Faraday. There also exists an adapter for Typhoeus, so people can continue using it.
The use cases for me are:
As far as I understand the only change needed would be to set the "library" option of the generator to "faraday" and to adjust the CI setup to install the according gem instead of Typhoeus. What do you think?