- Emit a deprecation warning when
JSON.load
create custom types without thecreate_additions
option being explictly enabled.- Prefer to use
JSON.unsafe_load(string)
orJSON.load(string, create_additions: true)
.
- Prefer to use
- Emit a deprecation warning when serializing valid UTF-8 strings encoded in
ASCII_8BIT
akaBINARY
. - Bump required_ruby_version to 2.7.
- More performance improvments to
JSON.dump
andJSON.generate
.
- Fix a memory leak when
#to_json
methods raise an exception. - Gracefully handle formatting configs being set to
nil
instead of""
. - Workaround another issue caused by conflicting versions of both
json_pure
andjson
being loaded.
- Workaround a bug in 3.4.8 and older rubygems/rubygems#6490. This bug would cause some gems with native extension to fail during compilation.
- Workaround different versions of
json
andjson_pure
being loaded (not officially supported). - Make
json_pure
Ractor compatible.
- Numerous performance optimizations in
JSON.generate
andJSON.dump
(up to 2 times faster). - Limit the size of ParserError exception messages, only include up to 32 bytes of the unparseable source.
- Fix json-pure's
Object#to_json
to accept non state arguments - Fix multiline comment support in
json-pure
. - Fix
JSON.parse
to no longer mutate the argument encoding when passed an ASCII-8BIT string. - Fix
String#to_json
to raise on invalid encoding injson-pure
. - Delete code that was based on CVTUTF.
- Use the pure-Ruby generator on TruffleRuby.
- Fix
strict
mode injson-pure
to not break on Integer.
- Use rb_sym2str instead of SYM2ID #561
- Fix memory leak when exception is raised during JSON generation #574
- Remove references to "19" methods in JRuby #576
- Make OpenStruct support as optional by @hsbt in #565
- Autoload JSON::GenericObject to avoid require ostruct warning in Ruby 3.4 #577
- Warn to install ostruct if json couldn't load it by @hsbt #578
- JSON.dump: handle unenclosed hashes regression #554
- Overload kwargs in JSON.dump #556
- [DOC] RDoc for additions #557
- Fix JSON.dump overload combination #558
- Add a strict option to Generator #519
escape_slash
option was renamed asscript_safe
and now also escape U+2028 and U+2029.escape_slash
is now an alias ofscript_safe
#525- Remove unnecessary initialization of create_id in JSON.parse() #454
- Improvements to Hash#to_json in pure implementation generator #203
- Use ruby_xfree to free buffers #518
- Fix "unexpected token" offset for Infinity #507
- Avoid using deprecated BigDecimal.new on JRuby #546
- Removed code for Ruby 1.8 #540
- Rename JSON::ParseError to JSON:ParserError #530
- Call super in included hook #486
- JRuby requires a minimum of Java 8 #516
- Always indent even if empty #517
- bugfix json/pure mixing escaped with literal unicode raises Encoding::CompatibilityError #483
- Stop including the parser source LINE in exceptions #470
- Remove unknown keyword arg from DateTime.parse #488
- Ignore java artifacts by @hsbt #489
- Fix parser bug for empty string allocation #496
- Restore version.rb with 2.6.1
- Use
rb_enc_interned_str
if available to reduce allocations infreeze: true
mode. #451. - Bump required_ruby_version to 2.3.
- Fix compatibility with
GC.compact
. - Fix some compilation warnings. #469
- Restore the compatibility for constants of JSON class.
- Ready to Ractor-safe at Ruby 3.0.
- Restore version.rb with 2.4.1
- Implement a freeze: parser option #447
- Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations #449
- Fix JSON.load_file doc #448
- Fix pure parser with unclosed arrays / objects #425
- bundle the LICENSE file in the gem #444
- Add an option to escape forward slash character #405
- RDoc for JSON #439 #446 #442 #434 #433 #430
- Spelling and grammar fixes for comments. Pull request #191 by Josh Kline.
- Enhance generic JSON and #generate docs. Pull request #347 by Victor Shepelev.
- Add :nodoc: for GeneratorMethods. Pull request #349 by Victor Shepelev.
- Baseline changes to help (JRuby) development. Pull request #371 by Karol Bucek.
- Add metadata for rubygems.org. Pull request #379 by Alexandre ZANNI.
- Remove invalid JSON.generate description from JSON module rdoc. Pull request #384 by Jeremy Evans.
- Test with TruffleRuby in CI. Pull request #402 by Benoit Daloze.
- Rdoc enhancements. Pull request #413 by Burdette Lamar.
- Fixtures/ are not being tested... Pull request #416 by Marc-André Lafortune.
- Use frozen string for hash key. Pull request #420 by Marc-André Lafortune.
- Added :call-seq: to RDoc for some methods. Pull request #422 by Burdette Lamar.
- Small typo fix. Pull request #423 by Marc-André Lafortune.
- Fix default of
create_additions
to always befalse
forJSON(user_input)
andJSON.parse(user_input, nil)
. Note thatJSON.load
remains with defaulttrue
and is meant for internal serialization of trusted data. [CVE-2020-10663] - Fix passing args all #to_json in json/add/*.
- Fix encoding issues
- Fix issues of keyword vs positional parameter
- Fix JSON::Parser against bigdecimal updates
- Bug fixes to JRuby port
- Adds support for 2.6 BigDecimal and ruby standard library Set datetype.
- Allow passing of
decimal_class
option to specify a class as which to parse JSON float numbers.
- Raise exception for incomplete unicode surrogates/character escape sequences. This problem was reported by Daniel Gollahon (dgollahon).
- Fix arbitrary heap exposure problem. This problem was reported by Ahmad Sherif (ahmadsherif).
- Set
required_ruby_version
to 1.9 - Some small fixes
- Specify
required_ruby_version
for json_pure. - Fix issue #295 failure when parsing frozen strings.
- Fix problem when requiring json_pure and Parser constant was defined top level.
- Add
RB_GC_GUARD
to avoid possible GC problem via Pete Johns. - Store
current_nesting
on stack by Aaron Patterson.
- Now complies to newest JSON RFC 7159.
- Implements compatibility to ruby 2.4 integer unification.
- Drops support for old rubies whose life has ended, that is rubies < 2.0. Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
- There were still some mentions of dual GPL licensing in the source, but JSON has just the Ruby license that itself includes an explicit dual-licensing clause that allows covered software to be distributed under the terms of the Simplified BSD License instead for all ruby versions >= 1.9.3. This is however a GPL compatible license according to the Free Software Foundation. I changed these mentions to be consistent with the Ruby license setting in the gemspec files which were already correct now.
- Be compatible with ancient ruby 1.8 (maybe?)
- Be compatible with ruby 2.4.0
- There were still some mentions of dual GPL licensing in the source, but JSON has just the Ruby license that itself includes an explicit dual-licensing clause that allows covered software to be distributed under the terms of the Simplified BSD License instead for all ruby versions >= 1.9.3. This is however a GPL compatible license according to the Free Software Foundation. I changed these mentions to be consistent with the Ruby license setting in the gemspec files which were already correct now.
- Fix potential memory leak, thx to nobu.
- Some performance improvements by Vipul A M [email protected].
- Fix by Jason R. Clark [email protected] to avoid mutation of
JSON.dump_default_options
. - More tests by Michael Mac-Vicar [email protected] and fixing
space_before
accessor in generator. - Performance on Jruby improved by Ben Browning [email protected].
- Some fixes to be compatible with the new Ruby 2.2 by Zachary Scott [email protected] and SHIBATA Hiroshi [email protected].
- Remove Rubinius exception since transcoding should be working now.
- Fix ruby#162 reported by Marc-Andre Lafortune [email protected]. Thanks!
- Applied patches by Yui NARUSE [email protected] to suppress warning with -Wchar-subscripts and better validate UTF-8 strings.
- Applied patch by ginriki@github to remove unnecessary if.
- Add load/dump interface to
JSON::GenericObject
to make serialize :some_attribute,JSON::GenericObject
work in Rails active models for convenientSomeModel#some_attribute.foo.bar
access to serialised JSON data.
- Security fix for JSON create_additions default value and
JSON::GenericObject
. It should not be possible to create additions unless explicitly requested by setting the create_additions argument to true or using the JSON.load/dump interface. IfJSON::GenericObject
is supposed to be automatically deserialised, this has to be explicitly enabled by setting JSON::GenericObject.json_creatable = true as well. - Remove useless assert in fbuffer implementation.
- Apply patch attached to https://github.com/ruby/json/issues#issue/155 provided by John Shahid [email protected], Thx!
- Add license information to rubygems spec data, reported by Jordi Massaguer Pla [email protected].
- Improve documentation, thx to Zachary Scott [email protected].
- Add
GeneratorState#merge
alias for JRuby, fix state accessor methods. Thx to jvshahid@github. - Increase hash likeness of state objects.
- Fix compilation of extension on older rubies.
- Fix compilation problem on AIX, see ruby#142
- Work around Rubinius encoding issues using iconv for conversion instead.
- Fix some encoding issues, that cause problems for the pure and the extension variant in jruby 1.9 mode.
- Some small fixes for building
- Add
JSON::GenericObject
for method access to objects transmitted via JSON.
- Fix possible crash when trying to parse nil value.
- Propagate src encoding to values made from it (fixes 1.9 mode converting everything to ascii-8bit; harmless for 1.8 mode too) (Thomas E. Enebo [email protected]), should fix https://github.com/ruby/json/issues#issue/119.
- Fix https://github.com/ruby/json/issues#issue/124 Thx to Jason Hutchens.
- Fix https://github.com/ruby/json/issues#issue/117
- Vit Ondruch [email protected] reported a bug that shows up when using optimisation under GCC 4.7. Thx to him, Bohuslav Kabrda [email protected] and Yui NARUSE [email protected] for debugging and developing a patch fix.
- Patches that improve speed on JRuby contributed by Charles Oliver Nutter [email protected].
- Support
object_class
/array_class
with duck typed hash/array.
- Let
JSON.load('')
return nil as well to make mysql text columns (default to''
) work better for serialization.
- Add support for OpenStruct and BigDecimal.
- Fix bug when parsing nil in
quirks_mode
. - Make JSON.dump and JSON.load methods better cooperate with Rails' serialize method. Just use: serialize :value, JSON
- Fix bug with time serialization concerning nanoseconds. Thanks for the patch go to Josh Partlow (jpartlow@github).
- Improve parsing speed for JSON numbers (integers and floats) in a similar way to what Evan Phoenix [email protected] suggested in: ruby#103
- Using -target 1.5 to force Java bits to compile with 1.5.
- Extract utilities (prettifier and GUI-editor) in its own gem json-utils.
- Split json/add/core into different files for classes to be serialised.
- Fix memory leak when used from multiple JRuby. (Patch by jfirebaugh@github).
- Apply patch by Eric Wong [email protected] that fixes garbage collection problem reported in ruby#46.
- Add :quirks_mode option to parser and generator.
- Add support for Rational and Complex number additions via json/add/complex and json/add/rational requires.
- Alias State#configure method as State#merge to increase duck type synonymy with Hash.
- Add
as_json
methods in json/add/core, so rails can create its json objects the new way.
- Apply documentation patch by Cory Monty [email protected].
- Add gemspecs for json and json_pure.
- Fix bug in jruby pretty printing.
- Fix bug in
object_class
andarray_class
when inheriting from Hash or Array.
- Made rake-compiler build a fat binary gem. This should fix issue https://github.com/ruby/json/issues#issue/54.
- Included Java source codes for the Jruby extension made by Daniel Luz [email protected].
- Output full exception message of
deep_const_get
to aid debugging. - Fixed an issue with ruby 1.9
Module#const_defined?
method, that was reported by Riley Goodside.
- Fixed oversight reported in http://github.com/ruby/json/issues/closed#issue/23, always create a new object from the state prototype.
- Made pure and ext api more similar again.
- Manage data structure nesting depth in state object during generation. This
should reduce problems with
to_json
method definіtions that only have one argument. - Some fixes in the state objects and additional tests.
- Fixes build problem for rubinius under OS X, http://github.com/ruby/json/issues/closed#issue/25
- Fixes crashes described in http://github.com/ruby/json/issues/closed#issue/21 and http://github.com/ruby/json/issues/closed#issue/23
- Fixed some test assertions, from Ruby r27587 and r27590, patch by nobu.
- Fixed issue http://github.com/ruby/json/issues/#issue/20 reported by electronicwhisper@github. Thx!
- Applied patch from naruse Yui NARUSE [email protected] to make building with Microsoft Visual C possible again.
- Applied patch from devrandom [email protected] in order to allow building of json_pure if extensiontask is not present.
- Thanks to Dustin Schneider [email protected], who reported a memory leak, which is fixed in this release.
- Applied 993f261ccb8f911d2ae57e9db48ec7acd0187283 patch from josh@github.
- Fix for a bug reported by Dan DeLeo [email protected], caused by T_FIXNUM being different on 32bit/64bit architectures.
- Major speed improvements and building with simplified directory/file-structure.
- Extension should at least be compatible with MRI, YARV and Rubinius.
- Trigger const_missing callback to make Rails' dynamic class loading work.
- Added a
State#[]
method which returns an attribute's value in order to increase duck type compatibility to Hash.
- Made some changes to make the building of the parser/generator compatible to Rubinius.
- Added
:symbolize_names
option to Parser, which returns symbols instead of strings in object names/keys.
fast_generate
now raises an exception for nan and infinite floats.- On Ruby 1.8 json supports parsing of UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, and UTF-32LE JSON documents now. Under Ruby 1.9 the M17n conversion functions are used to convert from all supported encodings. ASCII-8BIT encoded strings are handled like all strings under Ruby 1.8 were.
- Better documentation
- Added forgotten main doc file
extra_rdoc_files
.
- Applied a patch by OZAWA Sakuro [email protected] to make json/pure work in environments that don't provide iconv.
- Applied patch by okkez_ in order to fix Ruby Bug #1768: http://redmine.ruby-lang.org/issues/show/1768.
- Finally got around to avoid the rather paranoid escaping of ?/ characters in the generator's output. The parsers aren't affected by this change. Thanks to Rich Apodaca [email protected] for the suggestion.
- Security Fix for JSON::Pure::Parser. A specially designed string could cause catastrophic backtracking in one of the parser's regular expressions in earlier 1.1.x versions. JSON::Ext::Parser isn't affected by this issue. Thanks to Bartosz Blimke [email protected] for reporting this problem.
- This release also uses a less strict ruby version requirement for the creation of the mswin32 native gem.
- No changes. І tested native linux gems in the last release and they don't play well with different ruby versions other than the one the gem was built with. This release is just to bump the version number in order to skip the native gem on rubyforge.
- Started to build gems with rake-compiler gem.
- Applied patch object/array class patch from Brian Candler [email protected] and fixes.
- Fixed a bug in the creation of serialized generic rails objects reported by Friedrich Graeter [email protected].
- Deleted tests/runner.rb, we're using testrb instead.
- Editor supports Infinity in numbers now.
- Made some changes in order to get the library to compile/run under Ruby 1.9.
- Improved speed of the code path for the fast_generate method in the pure variant.
- Wesley Beary [email protected] reported a bug in json/add/core's DateTime handling: If the nominator and denominator of the offset were divisible by each other Ruby's Rational#to_s returns them as an integer not a fraction with '/'. This caused a ZeroDivisionError during parsing.
- Use Date#start and DateTime#start instead of sg method, while remaining backwards compatible.
- Supports ragel >= 6.0 now.
- Corrected some tests.
- Some minor changes.
- Remember default dir (last used directory) in editor.
- JSON::Editor.edit method added, the editor can now receive json texts from the clipboard via C-v.
- Load json texts from an URL pasted via middle button press.
- Added :create_additions option to Parser. This makes it possible to disable the creation of additions by force, in order to treat json texts as data while having additions loaded.
- Jacob Maine [email protected] reported, that JSON(:foo) outputs a JSON object if the rails addition is enabled, which is wrong. It now outputs a JSON string "foo" instead, like suggested by Jacob Maine.
- Discovered a bug in the Ruby Bugs Tracker on rubyforge, that was reported by John Evans [email protected]. He could produce a crash in the JSON generator by returning something other than a String instance from a to_json method. I now guard against this by doing a rather crude type check, which raises an exception instead of crashing.
- Yui NARUSE [email protected] sent some patches to fix tests for Ruby 1.9. I applied them and adapted some of them a bit to run both on 1.8 and 1.9.
- Introduced a
JSON.parse!
method without depth checking for people who like danger. - Made generate and
pretty_generate
methods configurable by an options hash. - Added :allow_nan option to parser and generator in order to handle NaN, Infinity, and -Infinity correctly - if requested. Floats, which aren't numbers, aren't valid JSON according to RFC4627, so by default an exception will be raised if any of these symbols are encountered. Thanks to Andrea Censi [email protected] for his hint about this.
- Fixed some more tests for Ruby 1.9.
- Implemented dump/load interface of Marshal as suggested in ruby-core:11405 by murphy [email protected].
- Implemented the
max_nesting
feature for generate methods, too. - Added some implementations for ruby core's custom objects for serialisation/deserialisation purposes.
- Implemented max_nesting feature for parser to avoid stack overflows for data from untrusted sources. If you trust the source, you can disable it with the option max_nesting => false.
- Piers Cawley [email protected] reported a bug, that not every
character can be escaped by
\
as required by RFC4627. There's a contradiction between David Crockford's JSON checker test vectors (in tests/fixtures) and RFC4627, though. I decided to stick to the RFC, because the JSON checker seems to be a bit older than the RFC. - Extended license to Ruby License, which includes the GPL.
- Added keyboard shortcuts, and 'Open location' menu item to edit_json.rb.
- Applied a patch from Yui NARUSE [email protected] to make JSON compile under Ruby 1.9. Thank you very much for mailing it to me!
- Made binary variants of JSON fail early, instead of falling back to the pure version. This should avoid overshadowing of eventual problems while loading of the binary.
- Improved performance of pure variant a bit.
- The ext variant of this release supports the mswin32 platform. Ugh!
- Ext Parser didn't parse 0e0 correctly into 0.0: Fixed!
- Forgot some object files in the build dir. I really like that - not!
- Added C implementations for the JSON generator and a ragel based JSON parser in C.
- Much more tests, especially fixtures from json.org.
- Further improved conformance to RFC4627.
- Conform more to RFC4627 for JSON: This means JSON strings
now always must contain exactly one object
"{ ... }"
or array"[ ... ]"
in order to be parsed without raising an exception. The definition of what constitutes a whitespace is narrower in JSON than in Ruby ([ \t\r\n]), and there are differences in floats and integers (no octals or hexadecimals) as well. - Added aliases generate and
pretty_generate
of unparse andpretty_unparse
. - Fixed a test case.
- Catch an
Iconv::InvalidEncoding
exception, that seems to occur on some Sun boxes with SunOS 5.8, if iconv doesn't support utf16 conversions. This was reported by Andrew R Jackson [email protected], thanks a bunch!
- Fixed a bug in handling solidi (/-characters), that was reported by Kevin Gilpin [email protected].
- Fixed a bug related to escaping with backslashes. Thanks for the report go to Florian Munz [email protected].
- Initial Rubyforge Version