| Name | Modified | Size | Downloads / 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_keygenerator options. By default a warning is now emitted when a duplicated key is encountered. Injson 3.0an error will be raised. ```rubyWarning[: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.generatestrict: truemode to also restrict hash keys. - Fix
JSON::Coderto also invoke block for hash keys that aren't strings nor symbols. - Fix
JSON.unsafe_loadusage 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