[ruby-nextgen] Let Configuration carry Faraday SSL options

Merged
N-
4mo ago
+36-6

A server presenting a certificate issued by a private CA is unreachable by a generated client: the default trust store holds public authorities only, and Configuration exposed no way to say otherwise.

The escape hatch it does offer, Configuration#use, cannot help here โ€” Faraday settles TLS when it builds the connection, before any middleware runs.

ssl is handed to Faraday verbatim, so anything the adapter understands works ({ ca_file: ... }, { verify: false }, client certificates). It defaults to an empty hash, which is what Faraday assumes when the option is absent, so generated clients are unchanged unless they set it.

client = Petstore::Client.new(base_url: "https://internal.example.org") do |config|
  config.ssl = { ca_file: "/path/to/root.crt" }
end

Changes

  • configuration.mustache: add the :ssl accessor, initialized to {}
  • connection.mustache: pass it to Faraday.new as a connection option
  • README.mustache: document it in the configuration example
  • Regenerate the petstore and qdrant samples

PR checklist

  • Read the contribution guidelines.
  • Samples regenerated for the affected generator (bin/configs/ruby-nextgen.yaml, bin/configs/ruby-nextgen-qdrant.yaml); no other generator output is touched by this change.
  • Targets master.

๐Ÿค– Generated with Claude Code


Summary by cubic

Adds SSL options support to ruby-nextgen clients by carrying Faraday ssl settings in Configuration and passing them when the connection is built. This lets clients connect to servers using private CAs or client certificates without changing defaults.

  • New Features
    • Add Configuration.ssl accessor (defaults to {}) for Faraday TLS options (e.g., { ca_file: "/path/to/root.crt" }, { verify: false }).
    • Pass ssl to Faraday.new so TLS is configured before middleware.
    • Update README and regenerate petstore and qdrant samples.