Closed ryan-mcneil closed 4 months ago
@iMacTia good catch on the typo 🤦 , and thanks for the feedback!
Release note: I'll be away most of the weekend so I'll cut a release on Monday if that's OK as I would hate to be unavailable in case anything goes wrong
Shoutout to @ericboehs for the assist!
Thanks @iMacTia! Looking forward to it!
This has just been released in v2.10.0 🚀
Description
This PR introduces a new feature to Faraday::Middleware: Default Options. While the concept of
DEFAULT_OPTIONS
isn't fundamentally new to Faraday, this PR provides some building blocks to introduce Default Options, and the ability to override them at the application level. While it has only been implemented in the RaiseError class, it can easily be added to other Faraday::Middleware classes for which there's a need.The suggestion was first mentioned here with some conversation and ideation afterwards. As our team did have a need for this functionality (i.e. setting a different default for
:include_request
), I created a little monkeypatch in our repo, and figured I'd submit a [much more thought out] addition to Faraday itself.My addition to the documentation (please let me know if you would like this elsewhere!) mostly sums up the general idea and how a user would implement it.
Addresses comment here
Additional Notes
The additional "feature" that I did not include in the documentation is that this implementation allows for
DEFAULT_OPTIONS
to be set at theFARADAY::MIDDLEWARE
level, that would be propagated to child classes. Leaving it blank for now allows for the feature to work as intended, but could open it up for additional configuration in future iterations of the gem. I'd love to hear your thoughts here.This is my first time contributing to a widely used gem, so be gentle 😆