Project

General

Profile

Actions

Defect #44428

open

JSON API requests fail with JSON gem 3.0.0

Added by Go MAEDA 1 day ago. Updated 1 day ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Gems support
Target version:
Resolution:
Fixed
Affected version:

Description

After updating the json gem to 3.0.0, JSON API requests with a request body (POST/PUT) fail, and many API tests fail with the following error:

Error:
Redmine::ApiTest::IssuesTest#test_GET_/issues/:id.json_with_no_spent_time_should_return_floats:
ArgumentError: wrong number of arguments (given 2, expected 1)
    test/integration/api_test/issues_test.rb:371:in 'block in <class:IssuesTest>'

This is caused by an incompatibility between json 3.0.0 and ActiveSupport in Rails 8.1.3.1. Rails has already fixed it in rails/rails#58601, but no Rails release includes the fix yet.

Currently, only trunk is affected. In 7.0-stable and 6.1-stable, the older RuboCop versions depend on json ~> 2.3, which prevents json 3.0.0 from being installed. Trunk uses RuboCop 1.90.0, which relaxed the requirement to json >= 2.3, so bundle update now installs json 3.0.0.

Until a Rails version containing the fix is released, json should be pinned to 2.x in the Gemfile:

gem "json", "< 3.0" 
Actions

Also available in: Atom PDF