Skip to content
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

Upgrade json_api_client #2436

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Upgrade json_api_client #2436

merged 1 commit into from
Sep 24, 2024

Conversation

jrmhaig
Copy link
Contributor

@jrmhaig jrmhaig commented Sep 24, 2024

What

Upgrade json_api_client and faraday_middleware together.

Ticket

N/A

Why

json_api_client has been updated to allow compatibility with both version 1 and 2 of Faraday. To do this the faraday_middleware gem was removed as this is not compatible with Faraday version 2. To facilitate this some middleware has been built in to Faraday 1 to mirror the behaviour of version 2. This has been done for the JSON firmware, which json_api_client uses, but not for the OAuth2 middleware, which we still require. Simply adding faraday_middleware back in for the OAuth2 middleware causes conflicts as the JSON middleware exists twice.

How

Add faraday_middleware and require at least version 1.2.1. This version has been fixed (lostisland/faraday#1595) to resolve conflicts and favours the built in version of any middleware that also exists in faraday_middleware.

The new version of json_api_client removes faraday_middleware to enable
compatibility with both version 1 and 2 of Faraday. However, faraday_middleware
is still required for the FaradaMiddleware::OAuth2. This causes conflicts as
json_api_client attempts to load middleware for JSON that exists both in the
faraday and faraday_middleware gems. Version 1.2.1 of the faraday_middleware
fixes this and ensures that the built in version of middleware is favoured.
Copy link

@jrmhaig jrmhaig marked this pull request as ready for review September 24, 2024 08:28
@jrmhaig jrmhaig requested a review from a team as a code owner September 24, 2024 08:28
@jrmhaig jrmhaig merged commit d51aaed into main Sep 24, 2024
11 of 12 checks passed
@jrmhaig jrmhaig deleted the upgrade_json_api_client branch September 24, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants