Releases: ruby/json
Releases · ruby/json
v2.12.0
What's Changed
- Improve floating point generation to not use scientific notation as much.
- Include line and column in parser errors. Both in the message and as exception attributes.
- Handle non-string hash keys with broken to_simplementations.
- JSON.generatenow uses SSE2 (x86) or NEON (arm64) instructions when available to escape strings.
Full Changelog: v2.11.3...v2.12.0
v2.11.3
What's Changed
- Fix a regression in JSON.pretty_generate that could cause indentation to be off once some #to_json has been called.
Full Changelog: v2.11.2...v2.11.3
v2.11.2
What's Changed
- Bring back JSON::PRETTY_STATE_PROTOTYPE with a deprecation
Full Changelog: v2.11.1...v2.11.2
v2.11.1
What's Changed
- Add back JSON.restore,JSON.unparse,JSON.fast_unparseandJSON.pretty_unparse.
 These were deprecated 16 years ago, but never emited warnings, only undocumented, so are
 still used by a few gems.
Full Changelog: v2.11.0...v2.11.1
v2.11.0
What's Changed
- Optimize Integer generation to be ~1.8x faster.
- Optimize Float generation to be ~10x faster.
- Fix JSON.loadproc argument to substitute the parsed object with the return value.
 This better matchMarshal.loadbehavior.
- Deprecate JSON.fast_generate(it's not any faster, so pointless).
- Deprecate JSON.load_default_options.
- Deprecate JSON.unsafe_load_default_options.
- Deprecate JSON.dump_default_options.
- Deprecate Kernel#j
- Deprecate Kernel#jj
- Remove outdated JSON.iconv.
- Remove Class#json_creatable?monkey patch.
- Remove deprecated JSON.restoremethod.
- Remove deprecated JSON.unparsemethod.
- Remove deprecated JSON.fast_unparsemethod.
- Remove deprecated JSON.pretty_unparsemethod.
- Remove deprecated JSON::UnparserErrorconstant.
- Remove outdated JSON::MissingUnicodeSupportconstant.
Full Changelog: v2.10.2...v2.11.0
v2.10.2
What's Changed
- Fix a potential crash in the C extension parser.
- Raise a ParserError on all incomplete unicode escape sequence. This was the behavior until 2.10.0unadvertently changed it.
- Ensure document snippets that are included in parser errors don't include truncated multibyte characters.
- Ensure parser error snippets are valid UTF-8.
- Fix JSON::GeneratorError#detailed_messageon Ruby < 3.2
Full Changelog: v2.10.1...v2.10.2
v2.10.1
v2.10.0
What's Changed
- strict: truenow accept symbols as values. Previously they'd only be accepted as hash keys.
- The C extension Parser has been entirely reimplemented from scratch.
- Introduced JSON::Coderas a new API allowing to customize how non native types are serialized in a non-global way.
- Introduced JSON::Fragmentto allow assembling cached fragments in a safe way.
- The Java implementation of the generator received many optimizations.
Full Changelog: v2.9.1...v2.10.0
v2.9.1
v2.9.0
What's Changed
- Fix C implementation of script_safeescaping to not confuse some other 3 wide characters with\u2028and\u2029.
 e.g.JSON.generate(["倩", "瀨"], script_safe: true)would generate the wrong JSON.
- JSON.dump(object, some_io)now write into the IO in chunks while previously it would buffer the entire JSON before writing.
- JSON::GeneratorErrornow has a- #invalid_objectattribute, making it easier to understand why an object tree cannot be serialized.
- Numerous improvements to the JRuby extension.
Full Changelog: v2.8.2...v2.9.0