<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/json/json_coder_test.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/json] Respect Coder depth when generating</title>
<updated>2025-11-27T13:01:57+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-11-24T16:41:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f192c73cccdfd81e4ac2206feadc48b2757c19c'/>
<id>2f192c73cccdfd81e4ac2206feadc48b2757c19c</id>
<content type='text'>
https://github.com/ruby/json/commit/9c36681b17
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/json/commit/9c36681b17
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/json] Test current behavior regarding depth for Coder</title>
<updated>2025-11-27T13:01:56+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-11-24T16:36:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=78aa8d5b1d62a04d7cb5492f653266c99f4c55a2'/>
<id>78aa8d5b1d62a04d7cb5492f653266c99f4c55a2</id>
<content type='text'>
Coder currently ignores its depth and always resets it to 0 when
generating a new JSON document.

https://github.com/ruby/json/commit/cca1f38316
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Coder currently ignores its depth and always resets it to 0 when
generating a new JSON document.

https://github.com/ruby/json/commit/cca1f38316
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/json] Invoke `as_json` callback for strings with invalid encoding</title>
<updated>2025-11-02T14:48:33+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-10-30T09:29:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5153a2dcb3f22cbfa1037764d491646ed5b127d5'/>
<id>5153a2dcb3f22cbfa1037764d491646ed5b127d5</id>
<content type='text'>
Fix: https://github.com/ruby/json/issues/873

This allow users to encode binary strings if they so wish.
e.g. they can use Base64 or similar, or chose to replace invalid
characters with something else.

https://github.com/ruby/json/commit/b1b16c416f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix: https://github.com/ruby/json/issues/873

This allow users to encode binary strings if they so wish.
e.g. they can use Base64 or similar, or chose to replace invalid
characters with something else.

https://github.com/ruby/json/commit/b1b16c416f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/json] Fix concurrent usage of JSON::Coder#dump</title>
<updated>2025-10-25T08:57:48+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-10-25T08:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8e8e327870b23bcf263e0210472e6ee87d19c424'/>
<id>8e8e327870b23bcf263e0210472e6ee87d19c424</id>
<content type='text'>
Fix: https://github.com/rails/rails/commit/90616277e3d8fc46c9cf35d6a7470ff1ea0092f7#r168784389

Because the `depth` counter is inside `JSON::State` it can't be used
concurrently, and in case of a circular reference the counter may be
left at the max value.

The depth counter should be moved outside `JSON_Generator_State` and
into `struct generate_json_data`, but it's a larger refactor.

In the meantime, `JSON::Coder` calls `State#generate_new` so I changed
that method so that it first copy the state on the stack.

https://github.com/ruby/json/commit/aefa671eca
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix: https://github.com/rails/rails/commit/90616277e3d8fc46c9cf35d6a7470ff1ea0092f7#r168784389

Because the `depth` counter is inside `JSON::State` it can't be used
concurrently, and in case of a circular reference the counter may be
left at the max value.

The depth counter should be moved outside `JSON_Generator_State` and
into `struct generate_json_data`, but it's a larger refactor.

In the meantime, `JSON::Coder` calls `State#generate_new` so I changed
that method so that it first copy the state on the stack.

https://github.com/ruby/json/commit/aefa671eca
</pre>
</div>
</content>
</entry>
<entry>
<title>`JSON::Coder` callback now recieve a second argument to mark object keys</title>
<updated>2025-09-19T10:30:10+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-09-18T18:33:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1042a0bdd893a268b23566fcf1bb3a26cbc0e8c6'/>
<id>1042a0bdd893a268b23566fcf1bb3a26cbc0e8c6</id>
<content type='text'>
e.g.
```ruby
{ 1 =&gt; 2 }
```

The callback will be invoked for `1` as while it has a native JSON
equivalent, it's not legal as an object name.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
e.g.
```ruby
{ 1 =&gt; 2 }
```

The callback will be invoked for `1` as while it has a native JSON
equivalent, it's not legal as an object name.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix `JSON::Coder` to cast non-string keys.</title>
<updated>2025-08-27T01:01:52+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-08-23T14:58:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0e0f0dfd070fc156ec74c58f44d86a884a0580e0'/>
<id>0e0f0dfd070fc156ec74c58f44d86a884a0580e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix JSON::Coder to call as_json proc for NaN and Infinity</title>
<updated>2025-02-06T07:02:03+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-02-05T11:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f865148e1926f838cac8b4449abfc5d402d0d015'/>
<id>f865148e1926f838cac8b4449abfc5d402d0d015</id>
<content type='text'>
Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce JSON::Coder</title>
<updated>2025-01-28T06:41:47+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2024-12-16T11:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89e316ad06f28f473030da04f33711328dc143c5'/>
<id>89e316ad06f28f473030da04f33711328dc143c5</id>
<content type='text'>
Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
