-
Notifications
You must be signed in to change notification settings - Fork 988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add json middleware to 1.x #1400
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cherry picked from commit 5366029)
Merging this as it's pretty much the same as what we shipped with v2 👍 |
calbearox
reviewed
Feb 19, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
mkmn
added a commit
to mkmn/mrkt
that referenced
this pull request
Nov 24, 2022
faraday_middleware is deprecated, and does not support Faraday v2. From v1.10.0, faraday is bundled json middleware, and this gem can support Faraday v2. * Require Faraday v1.10 or higher * backport json middleware from this version. * ref. lostisland/faraday#1400 * require `faraday-multipart` * From Faraday v2, multipart middleware have been moved to separate faraday-multipart gem. * Add CI matrix * Run tests on both versions of Faraday.
mkmn
added a commit
to mkmn/mrkt
that referenced
this pull request
Nov 24, 2022
faraday_middleware is deprecated, and does not support Faraday v2. From v1.10.0, faraday is bundled json middleware, and this gem can support Faraday v2. * Require Ruby: v2.6 or higer * Faraday v2 required Ruby v2.6 * Require Faraday: v1.10 or higher * backport json middleware from this version. * ref. lostisland/faraday#1400 * require `faraday-multipart` * From Faraday v2, multipart middleware have been moved to separate faraday-multipart gem. * Add CI matrix * Run tests on both versions of Faraday.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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