json
json copied to clipboard
JSON implementation for Ruby
### Motivation / Background This Pull Request has been created because to fix #563 The output for the hash is inconsistent when using `JSON.dump` with the duplicate key. Specifically, if...
* Using the benchmark from https://github.com/flori/json/pull/580 ``` $ ruby benchmarks/bench.rb dump pure JSON::Pure::Generator truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux] Warming up -------------------------------------- JSON.dump(obj) 116.000 i/100ms JSON.dump(obj) 235.000...
* Restoring benchmarks/ohai.json from dad9fbfbfbfcfe743563348f2c17aedecfabe803. The commit intended to fix #117, that's still fixed as these new files are not included in the gem `s.files =`.
From 1998 to 2007, the Unicode Consortium maintained a library called CVTUTF. In 2009, CVTUTF was removed from unicode.org, and the Unicode Consortium said that every version of CVTUTF had...
# Summary The commit https://github.com/flori/json/commit/f65f2282 introduced a change in the `to_json` method that breaks `Time.to_json`. # Reproduction ```ruby require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "json_pure" end require "json/pure" puts...
`json/add/core` does not support Symbols for Hash keys today. This is a major issue for downstream systems like Sidekiq which rely on JSON for serialization because we can't transparently serialize...
This PR speeds up `JSON.generate` by approximately 1.75x (485k instructions per second -> 840k instructions per second) for [the benchmark of Oj](https://www.ohler.com/dev/oj_misc/performance_compat.html). This makes `JSON.generate` nearly as fast as `Oj.dump`....
Hi, I'm seeking confirmation regarding the compatibility of the json gem version 2.7.1 (released December 05, 2023) with the recently released Ruby 3.3.0 (December 25, 2023). While I reviewed the...
### Steps to reproduce ``` require "minitest/autorun" require "json" class DumpTest < Minitest::Test def test_dump_duplicate_key_hash assert_equal "{\"a\":5,\"c\":{\"b\":6}}", JSON.dump({ 'a' => 1, a: 5, c: { 'b' => 2, b: 6...
It's unclear what methods `object_class` and `array_class` should respond_to. Is it only `.new` and `#[]=` / `.new` and `#