Globally changing the behavior of the library is a bad idea, as many different libraries may rely on json and may not expect it and likely never tested that a different default config works for them.
If you need to change the behavior of JSON, it's best to do it only locally, and not globally.
In addition the new JSON::Coder interface is much more suited for that.
Another reason for the deprecation is that it's impossible to make JSON.load and JSON.dump Ractor-safe with such API.
[ruby/json] Deprecate all
*_default_optionsGlobally changing the behavior of the library is a bad idea, as
many different libraries may rely on
jsonand may not expect itand likely never tested that a different default config works for them.
If you need to change the behavior of JSON, it's best to do it only
locally, and not globally.
In addition the new
JSON::Coderinterface is much more suited forthat.
Another reason for the deprecation is that it's impossible to
make
JSON.loadandJSON.dumpRactor-safe with such API.https://github.com/ruby/json/commit/172762c6e4