Releases: ruby/json
Releases · ruby/json
v2.19.0
What's Changed
- Fix
allow_blankparsing option to no longer allow invalid types (e.g.load([], allow_blank: true)now raise a type error). - Add
allow_invalid_escapeparsing option to ignore backslashes that aren't followed by one of the valid escape characters.
Full Changelog: v2.18.1...v2.19.0
v2.18.1
What's Changed
- Fix a potential crash in very specific circumstance if GC triggers during a call to
to_json
without first invoking a user defined#to_jsonmethod.
Full Changelog: v2.18.0...v2.18.1
v2.18.0
What's Changed
- Add
:allow_control_charactersparser options, to allow JSON strings containing unescaped ASCII control characters (e.g. newlines).
Full Changelog: v2.17.1...v2.18.0
v2.17.1
What's Changed
- Fix a regression in parsing of unicode surogate pairs (
\uXX\uXX) that could cause an invalid string to be returned.
Full Changelog: v2.17.0...v2.17.1
v2.17.0
What's Changed
- Improve
JSON.loadandJSON.unsafe_loadto allow passing options as second argument. - Fix the parser to no longer ignore invalid escapes in strings.
Only\",\\,\b,\f,\n,\r,\tand\uare valid JSON escapes. - Fixed
JSON::Coderto use the depth it was initialized with. - On TruffleRuby, fix the generator to not call
to_jsonon the return value ofas_jsonforFloat::NAN. - Fixed handling of
state.depth: whento_jsonchangesstate.depthbut does not restore it, it is reset
automatically to its initial value.
In particular, when aNestingErroris raised,depthis no longer equal tomax_nestingafter the call to
generate, and is reset to its initial value. Similarly whento_jsonraises an exception.
Full Changelog: v2.16.0...v2.17.0
v2.16.0
What's Changed
- Deprecate
JSON::State#[]andJSON::State#[]=. Consider usingJSON::Coderinstead. JSON::Codernow also yields to the block when encountering strings with invalid encoding.- Fix GeneratorError messages to be UTF-8 encoded.
- Fix memory leak when
Exceptionis raised, orthrowis used during JSON generation. - Optimized floating point number parsing by integrating the ryu algorithm (thanks to Josef Šimánek).
- Optimized numbers parsing using SWAR (thanks to Scott Myron).
- Optimized parsing of pretty printed documents using SWAR (thanks to Scott Myron).
Full Changelog: v2.15.2...v2.16.0
v2.15.2
What's Changed
- Fix
JSON::Coderto have one dedicated depth counter per invocation.
After encountering a circular reference inJSON::Coder#dump, any further#dumpcall would raiseJSON::NestingError.
Full Changelog: v2.15.1...v2.15.2
v2.15.1
What's Changed
- Fix incorrect escaping in the JRuby extension when encoding shared strings.
Full Changelog: v2.15.0...v2.15.1
v2.15.0
What's Changed
JSON::Codercallback now receive a second argument to convey whether the object is a hash key.- Tuned the floating point number generator to not use scientific notation as aggressively.
Full Changelog: v2.14.1...v2.15.0
v2.14.1
What's Changed
- Fix
IndexOutOfBoundsExceptionin the JRuby extension when encoding shared strings.
Full Changelog: v2.14.0...v2.14.1