Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Gems that rely on the json middleware have a hard time supporting both Faraday v1 and v2, because the json middleware is not bundled as an independent gem. It's included in v2, but it's only available via faraday_middleware for v1.
This causes the situation where a gem can't support both Faraday v1 and v2, as that will require a dependency on
faraday_middleware
, which will prevent the gem from being used with Faraday v2.This PR backports the json middleware to Faraday v1 as well, so that gems can support both v1.10+ and v2
Todos
List any remaining work that needs to be done, i.e:
Additional Notes
I've tested this locally for conflicts with
faraday_middleware
.Things work even if
faraday_middleware
is added to the mix and required, but the middleware in there takes priority over the one bundled. I guess that's OK though