Releases: ruby/json
Releases Β· ruby/json
v2.12.2
v2.12.1
What's Changed
- Fix a potential crash in large negative floating point number generation.
- Fix for JSON.pretty_generate to use passed state object's generate instead of state class as the required parameters aren't available.
Full Changelog: v2.12.0...v2.12.1
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_s
implementations. JSON.generate
now 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_unparse
andJSON.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.load
proc argument to substitute the parsed object with the return value.
This better matchMarshal.load
behavior. - 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.restore
method. - Remove deprecated
JSON.unparse
method. - Remove deprecated
JSON.fast_unparse
method. - Remove deprecated
JSON.pretty_unparse
method. - Remove deprecated
JSON::UnparserError
constant. - Remove outdated
JSON::MissingUnicodeSupport
constant.
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.0
unadvertently 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_message
on Ruby < 3.2
Full Changelog: v2.10.1...v2.10.2
v2.10.1
v2.10.0
What's Changed
strict: true
now 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::Coder
as a new API allowing to customize how non native types are serialized in a non-global way. - Introduced
JSON::Fragment
to 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