Download Latest Version v2.18.0 source code.tar.gz (888.3 kB)
Email in envelope

Get an email when there's a new version of JSON implementation for Ruby

Home / v2.17.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-12-03 867 Bytes
v2.17.0 source code.tar.gz 2025-12-03 887.8 kB
v2.17.0 source code.zip 2025-12-03 929.2 kB
Totals: 3 Items   1.8 MB 0

What's Changed

  • Improve JSON.load and JSON.unsafe_load to allow passing options as second argument.
  • Fix the parser to no longer ignore invalid escapes in strings. Only \", \\, \b, \f, \n, \r, \t and \u are valid JSON escapes.
  • Fixed JSON::Coder to use the depth it was initialized with.
  • On TruffleRuby, fix the generator to not call to_json on the return value of as_json for Float::NAN.
  • Fixed handling of state.depth: when to_json changes state.depth but does not restore it, it is reset automatically to its initial value. In particular, when a NestingError is raised, depth is no longer equal to max_nesting after the call to generate, and is reset to its initial value. Similarly when to_json raises an exception.

Full Changelog: https://github.com/ruby/json/compare/v2.16.0...v2.17.0

Source: README.md, updated 2025-12-03