Skip to content

Make multi_json compatible with json 3.x - #67

Merged
byroot merged 1 commit into
sferik:mainfrom
byroot:json-3.x
Aug 12, 2026
Merged

byroot merged 1 commit into
sferik:mainfrom
byroot:json-3.x

Conversation

@byroot

@byroot byroot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Ref: https://github.com/ruby/json/releases/tag/v3.0.0.rc1

Unknown keyword arguments will raise ArgumentError.

  • quirks_mode: no longer existing since json 2.0 (~2011).
  • create_additions no longer existing in json 3.0.

NB: rubocop prevent installing the RC, so I only did some local testing after messing with the Gemfile.

Comment thread lib/multi_json/adapters/json_gem.rb Outdated
@sferik

sferik commented Aug 12, 2026

Copy link
Copy Markdown
Owner

To handle RuboCop preventing json 3 from being installed, what would you think about moving the linters into a group :lint and adding a test matrix job that runs with bundle config set --local without lint and an unpinned json gem? Happy to do that in a separate PR if you'd prefer.

Ref: https://github.com/ruby/json/releases/tag/v3.0.0.rc1

Unknown keyword arguments will raise `ArgumentError`.

- `quirks_mode:` no longer existing since json 2.0 (~2011).
- `create_additions` no longer existing in json 3.0.
@byroot

byroot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

what would you think about moving the linters into a group :lint

I don't thin that would be enough, as the constraints would still apply.

I did submit a PR to rubocop which was merged, hopefully it's released soon.

@byroot
byroot merged commit 7d14b25 into sferik:main Aug 12, 2026
25 checks passed
@byroot
byroot deleted the json-3.x branch August 12, 2026 22:23
@byroot

byroot commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@sferik sorry to be a bother, but could I request a new release? I released json 3.0.0 this morning, and now a few projects test suites are broken as they need a new version of multi_json.

@vpellan

vpellan commented Sep 7, 2026

Copy link
Copy Markdown

Hello! Sincemulti_json 1.20+ is only compatible with Ruby 3.2+, can this fix be backported tomulti_json 1.19 branch? Both multi_json 1.19 and json 3 are compatible with Ruby 3.0/3.1 but multi_json 1.19 gemspec does not prevent json 3+

@sferik

sferik commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

@byroot No bother. I will cut a new multi_json release this morning.

@vpellan Can you say a bit more about why you’d like support for Ruby 3.0 and 3.1? As you’re probably aware, support for Ruby 3.0 ended over 2 years ago. There are several known security vulnerabilities that are unpatched in the latest 3.0.7 and 3.1.7 releases. If it’s important to you to run the latest version of json/multi_json, I’d expect you’d also be interested to upgrade your Ruby version to one that is still supported.

If I go ahead with this backport, how much longer would you expect me to support Ruby 3.0 and 3.1? The json gem still supports Ruby 2.7, which has been EOL for over three years. Would you expect multi_json to support that version as well? I hope you are not offended by me mentioning this, but would @DataDog be interested in sponsoring this work? Generally speaking, long-term support for EOL versions requires a corporate sponsor.

sferik added a commit that referenced this pull request Sep 7, 2026
Bump the version to 1.21.2 and add the changelog section covering the
changes since 1.21.1: json 3.x support in the json_gem adapter
(#67), the JRuby adapter
preference reorder that puts json_gem ahead of jrjackson, and the fix
for a falsy :pretty option
(#70).

Update the README adapter preference table to match the new JRuby
order, since it still listed jrjackson first.
@sferik

sferik commented Sep 7, 2026

Copy link
Copy Markdown
Owner

:shipit: Shipped!

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.

3 participants