v3.0.0.rc1
Pre-releaseWith the removal of the insecure create_additions option, JSON.load and JSON.dump are
now safe to use. Them being unsafe by default caused multiple security vulnerabilites in the past.
If you did depend on create_additions, the recommended migration is to implement a custom serializer using
JSON::Coder.
All the mutable default options, such as JSON.load_default_options have been removed.
They were preventing Ractor compatiblity, and causing bug in libraries using JSON expecting the default behavior.
JSON methods now always behave the same unless monkey patched.
All methods options are now either keyword arguments or checked like keyword arguments, meaning
unknown options such as typos raise ArgumentError.
Duplicated keys are now rejected by default.
JavaScript comments in documents are no longer supported by default.
Numerous rarely used aliases have been removed.
JSON.loaddefaults are now safe to use.- All unknown options are now cause an
ArgumentErrorrather than to be ignored. - The
allow_commentsparsing option now default tofalse. - The
allow_duplicate_keyoption now defaults tofalse, for both parsing and generating JSON. - Removed the
limitpositional argument ofJSON.dump. - Removed the
escape_slashalias ofscript_safe. - Removed
Kernel#jandKernel#jj. - Removed
JSON.load_default_options. - Removed
JSON.unsafe_load_default_options. - Removed
JSON.dump_default_options. - Removed
JSON::State#[]andJSON::State#[]=. - Removed
JSON.unparse. - Removed
JSON.fast_generate. - Removed
JSON.fast_unparse. - Removed
JSON.pretty_unparse. - Removed
JSON.restore. - Removed
JSON::PRETTY_STATE_PROTOTYPE. - Removed the insecure
create_additionsoption. - Removed
JSON::GenericObject.
Full Changelog: v2.21.2...v3.0.0.rc1