Skip to content

Fix json >= 3.0 compatibility - #115

Merged
dblock merged 2 commits into
masterfrom
fix-json-3-compat
Sep 17, 2026
Merged

dblock merged 2 commits into
masterfrom
fix-json-3-compat

Conversation

@dblock

@dblock dblock commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Description

Fixes #113.

Faraday v2.14.4 supports json gem 3.x by passing JSON parser options as keyword arguments. This PR requires Faraday >= 2.14.4 and continues to use Faraday's built-in :json response middleware, so no local middleware replacement is needed.

The json ~> 2.3 development pin is removed, and the json-3 appraisal is enabled in CI.

Testing

  • bundle exec rake spec
  • BUNDLE_GEMFILE=gemfiles/json_2.gemfile bundle exec rake spec
  • BUNDLE_GEMFILE=gemfiles/json_3.gemfile bundle exec rake spec

Replace Faraday's built-in :json response middleware, which calls
JSON.parse(body, options) positionally, with Strava::Web::JsonResponse,
a subclass that calls JSON.parse(body) with a single argument. This
works with both json < 3.0 and json >= 3.0, which made options keyword-only.

Also uncomments the json-3 appraisal in CI now that it passes, and
removes the json ~> 2.3 pin from the Gemfile since it's no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Danger Report

No issues found.

View run

Faraday 2.14.4 supports json 3 by forwarding parser options as\nkeyword arguments. Require that version and restore Faraday's built-in\n:json response middleware, removing the no-longer-needed local override.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock merged commit 6680a5d into master Sep 17, 2026
26 checks passed
@dblock
dblock deleted the fix-json-3-compat branch September 17, 2026 14:21
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.

Faraday::ParsingError with json gem >= 3.0 (ArgumentError: wrong number of arguments)

1 participant