Actions
Defect #44428
openJSON API requests fail with JSON gem 3.0.0
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"
Updated by Go MAEDA 1 day ago
I am planning to do the following:
- When a Rails 8.1 release that includes rails/rails#58601 is available, update Rails in trunk and 7.0-stable. The pin in trunk will be removed at the same time.
- At the same time, backport the pin to 6.1-stable. Rails 7.2 is no longer maintained, so 6.1-stable will not get a fixed Rails version.
Actions