Download Latest Version v2.15.2 source code.tar.gz (857.3 kB)
Email in envelope

Get an email when there's a new version of JSON implementation for Ruby

Home / v2.14.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-09-18 980 Bytes
v2.14.0 source code.tar.gz 2025-09-18 855.9 kB
v2.14.0 source code.zip 2025-09-18 895.4 kB
Totals: 3 Items   1.8 MB 0

What's Changed

  • Add new allow_duplicate_key generator options. By default a warning is now emitted when a duplicated key is encountered. In json 3.0 an error will be raised. ```ruby

    Warning[:deprecated] = true puts JSON.generate({ foo: 1, "foo" => 2 }) (irb):2: warning: detected duplicate key "foo" in {foo: 1, "foo" => 2}. This will raise an error in json 3.0 unless enabled via allow_duplicate_key: true {"foo":1,"foo":2} JSON.generate({ foo: 1, "foo" => 2 }, allow_duplicate_key: false) detected duplicate key "foo" in {foo: 1, "foo" => 2} (JSON::GeneratorError) ```

  • Fix JSON.generate strict: true mode to also restrict hash keys.
  • Fix JSON::Coder to also invoke block for hash keys that aren't strings nor symbols.
  • Fix JSON.unsafe_load usage with proc
  • Fix the parser to more consistently reject invalid UTF-16 surogate pairs.

Full Changelog: https://github.com/ruby/json/compare/v2.13.2...v2.14.0

Source: README.md, updated 2025-09-18