savonrb / savon

Heavy metal SOAP client
https://www.savonrb.com
MIT License
2.07k stars 616 forks source link

Faraday upgrade docs #1009

Closed pcai closed 2 months ago

pcai commented 2 months ago

What kind of change is this?

Take a first pass at docs for faraday changes. Looking for feedback on wording as well as what else to include

Also minor cleanup throughout that was missed in original pr, basically all cosmetic nits.

pcai commented 2 months ago

cc @LukeIGS in case you are able to take a look, tried to turn your comments into a guide for users of the lib, it could definitely use a proofread if you have the time.

LukeIGS commented 2 months ago

So far the biggest thing i see missing is a mention about how custom adapters function now, they use the faraday approach instead of the httpi approach, https://lostisland.github.io/faraday/#/adapters/index

As seen here... also i noticed the option's doc comment still mentions httpi (because of course i missed another one) https://github.com/savonrb/savon/blob/main/spec/savon/options_spec.rb#L914

Essentially they take an array which gets forwarded to Faraday.new |c| c.adapter(:adapter_key, *) end where the first entry of the array is the adapter key, and all following entries are parameters for the adapter... So for example

stubs = Faraday::Adapter::Test::Stubs.new
stubs.get(@server.url('authentication')) do
    [200, {'Content-Type': 'application/xml'}, Fixture.wsdl('authentication')]
end

Savon.client(
  adapter: [:test, stubs]
)

would initialize all downstream faraday connections with the the inbuilt faraday test adapter and its first argument is a stubs list. This would likely be necessary if someone decided they wanted to use Typhoeus or something.

I'm mulling over how the heck i'd write that into the docs...

pcai commented 2 months ago

i merge this in for now so i can begin to prepare the release out of main