Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug] JSON payload decoding raises ArgumentError with json 3.x (JSON.parse options are keyword-only)

Open Beginner friendly
#595 3 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@chris-olszewski is already working on this.

Since Oct 6, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
json, ruby
Domain
backend

Research direction

Start in temporalio/lib/temporalio/converters/payload_converter/json_plain.rb and run the minimal reproduction with json 3.x. Check both JSON.parse call paths and verify that payload decoding works with json 2.x and 3.x, including encoded failure attributes, while JSON generation remains unaffected.

Written by the indexing model from the issue text.

Description

What are you really trying to do?

Decode JSON payloads (and failures with encode_common_attributes: true) with json 3.x installed.

Describe the bug

json 3.0 changed JSON.parse to take its options as keyword arguments only:

def parse(source, on_load: nil, object_class: nil, array_class: nil, **options)

Temporalio::Converters::PayloadConverter::JSONPlain#from_payload passes them as a positional hash:

JSON.parse(payload.data, @parse_options)

(temporalio/lib/temporalio/converters/payload_converter/json_plain.rb, both branches, still present on main.)

So with json >= 3.0 every JSON payload decode raises:

ArgumentError: wrong number of arguments (given 2, expected 1)
  json-3.0.2/lib/json/common.rb:296:in `parse'
  temporalio-1.9.0/lib/temporalio/converters/payload_converter/json_plain.rb:55:in `from_payload'
  temporalio-1.9.0/lib/temporalio/converters/payload_converter/composite.rb:66:in `from_payload'
  temporalio-1.9.0/lib/temporalio/converters/data_converter.rb:90:in `from_payloads'

A quieter side effect: FailureConverter#from_failure ignores errors while decoding encoded_attributes, so with encode_common_attributes: true the decoded error's message is left as "Encoded failure" and nothing is raised.

Encoding is unaffected: JSON.generate(value, @generate_options) still accepts a positional hash in json 3.

temporalio.gemspec doesn't constrain json, so a fresh resolve picks up 3.x.

Minimal Reproduction
# Gemfile: gem "temporalio", "1.9.0"; gem "json", "3.0.2"
require "temporalio/converters"

dc = Temporalio::Converters::DataConverter.default
dc.from_payloads(dc.to_payloads([{ "a" => 1 }]))
# => ArgumentError: wrong number of arguments (given 2, expected 1)

Passes with json 2.21.2.

Suggested fix

Splat the options so it works on both json 2.x and 3.x:

JSON.parse(payload.data, **@parse_options)

and/or add json to the gemspec with a lower bound that supports keyword options.

Environment/Versions
  • temporalio 1.9.0 (also present on main)
  • json 3.0.2
  • Ruby 3.2, 3.3, 3.4 (reproduced on all three in CI; locally on 3.3.4, arm64-darwin)
Additional context

Workaround: pin gem "json", "< 3" in the application's Gemfile.

Dominant language
Ruby
Stars
207
Forks
44
Avg merge
2d 16h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from temporalio/sdk-ruby

All issues in temporalio/sdk-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.