Skip to content

Releases: ruby/json

v2.12.2

23 May 15:11
Compare
Choose a tag to compare
  • Fix compiler optimization level.

Full Changelog: v2.12.1...v2.12.2

v2.12.1

23 May 15:11
Compare
Choose a tag to compare

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

23 May 15:10
Compare
Choose a tag to compare

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

05 May 12:40
Compare
Choose a tag to compare

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

05 May 12:39
Compare
Choose a tag to compare

What's Changed

  • Bring back JSON::PRETTY_STATE_PROTOTYPE with a deprecation

Full Changelog: v2.11.1...v2.11.2

v2.11.1

24 Apr 13:12
Compare
Choose a tag to compare

What's Changed

  • Add back JSON.restore, JSON.unparse, JSON.fast_unparse and JSON.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

24 Apr 08:13
Compare
Choose a tag to compare

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 match Marshal.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

12 Mar 13:12
Compare
Choose a tag to compare

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

12 Feb 11:12
Compare
Choose a tag to compare

What's Changed

  • Fix a compatibility issue with MultiJson.dump(obj, pretty: true) by @byroot in #749

Full Changelog: v2.10.0...v2.10.1

v2.10.0

10 Feb 11:05
Compare
Choose a tag to compare

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