Skip to content

Deprecate all *_default_options #773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

casperisfine
Copy link

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.

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.
@byroot byroot merged commit ffa9019 into ruby:master Mar 26, 2025
33 checks passed
@casperisfine casperisfine deleted the deprecate-global-configs branch March 26, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants