Skip to content

v3.2.0

Latest

Choose a tag to compare

@byroot byroot released this 24 Nov 08:50

What's Changed

  • The script_safe: true option of JSON.generate no longer escapes forward slashes /, and instead escapes script tag
    openings (<script), script tag closing (</script) and HTML comments (<!--) as recommended by the HTML spec.
  • The script_safe: true option of JSON.generate no longer escapes U+2028 and U+2029 given that Javascript is
    now a proper subset of JSON since many years (see: https://github.com/tc39/proposal-json-superset).
  • Fix JSON::ParserError#json_path raising NoMethodError when the document was parsed with symbolize_names: true.
  • Fix JSON.generate not detecting duplicate keys such as { "1" => 1, 1 => 2 }.
  • JRuby: raise TypeError when a String subclass used as a Hash key has a to_s that doesn't return a String, like the C extension.
  • JRuby and TruffleRuby: fix a stack overflow in JSON::Coder when as_json returns a Symbol for a string with invalid encoding.
  • JRuby: fix JSON::Coder (and any frozen JSON::State) not being thread-safe. Each #dump call now uses its own nesting depth instead of mutating the shared state, which under concurrent use could make every later call raise JSON::NestingError.

Full Changelog: v3.1.0...v3.2.0