json 2.13.2-java → 2.14.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +25 -8
- data/lib/json/add/core.rb +1 -0
- data/lib/json/add/string.rb +35 -0
- data/lib/json/common.rb +32 -7
- data/lib/json/ext/generator/state.rb +7 -14
- data/lib/json/ext/generator.jar +0 -0
- data/lib/json/ext/parser.jar +0 -0
- data/lib/json/generic_object.rb +0 -8
- data/lib/json/truffle_ruby/generator.rb +45 -35
- data/lib/json/version.rb +1 -1
- data/lib/json.rb +23 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf285376b5311a27df8445b1a11f04d363da0841b0d78e01a5bef242c9a9f043
|
4
|
+
data.tar.gz: c87f93c45bcf5d74c8f34e5c90a40f8f0e1fa031ce7265b63262d834c533e1a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330c4f9af6227e5328988b26d6f5ab89f7c4a9be84b6e721f4458e317b2e61085bee5a8b819538a092205e8e88c834c8e1552e9c6cc0ed542e3441489850213e
|
7
|
+
data.tar.gz: 3bba15252557d73cf0c1ae6b9eb96914d11eb9b5e4115ea8fe2f0b5d7ad9f31c1ccb248051256111d2ba27b169095b7e61628e8909950ce8ef8126a200d209d8
|
data/CHANGES.md
CHANGED
@@ -2,6 +2,22 @@
|
|
2
2
|
|
3
3
|
### Unreleased
|
4
4
|
|
5
|
+
* Add new `allow_duplicate_key` generator options. By default a warning is now emitted when a duplicated key is encountered.
|
6
|
+
In `json 3.0` an error will be raised.
|
7
|
+
```ruby
|
8
|
+
>> Warning[:deprecated] = true
|
9
|
+
>> puts JSON.generate({ foo: 1, "foo" => 2 })
|
10
|
+
(irb):2: warning: detected duplicate key "foo" in {foo: 1, "foo" => 2}.
|
11
|
+
This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
|
12
|
+
{"foo":1,"foo":2}
|
13
|
+
>> JSON.generate({ foo: 1, "foo" => 2 }, allow_duplicate_key: false)
|
14
|
+
detected duplicate key "foo" in {foo: 1, "foo" => 2} (JSON::GeneratorError)
|
15
|
+
```
|
16
|
+
* Fix `JSON.generate` `strict: true` mode to also restrict hash keys.
|
17
|
+
* Fix `JSON::Coder` to also invoke block for hash keys that aren't strings nor symbols.
|
18
|
+
* Fix `JSON.unsafe_load` usage with proc
|
19
|
+
* Fix the parser to more consistently reject invalid UTF-16 surogate pairs.
|
20
|
+
|
5
21
|
### 2025-07-28 (2.13.2)
|
6
22
|
|
7
23
|
* Improve duplicate key warning and errors to include the key name and point to the right caller.
|
@@ -44,7 +60,7 @@
|
|
44
60
|
### 2025-04-24 (2.11.1)
|
45
61
|
|
46
62
|
* Add back `JSON.restore`, `JSON.unparse`, `JSON.fast_unparse` and `JSON.pretty_unparse`.
|
47
|
-
These were deprecated 16 years ago, but never
|
63
|
+
These were deprecated 16 years ago, but never emitted warnings, only undocumented, so are
|
48
64
|
still used by a few gems.
|
49
65
|
|
50
66
|
### 2025-04-24 (2.11.0)
|
@@ -71,7 +87,7 @@
|
|
71
87
|
### 2025-03-12 (2.10.2)
|
72
88
|
|
73
89
|
* Fix a potential crash in the C extension parser.
|
74
|
-
* Raise a ParserError on all incomplete unicode escape sequence. This was the behavior until `2.10.0`
|
90
|
+
* Raise a ParserError on all incomplete unicode escape sequence. This was the behavior until `2.10.0` inadvertently changed it.
|
75
91
|
* Ensure document snippets that are included in parser errors don't include truncated multibyte characters.
|
76
92
|
* Ensure parser error snippets are valid UTF-8.
|
77
93
|
* Fix `JSON::GeneratorError#detailed_message` on Ruby < 3.2
|
@@ -102,7 +118,7 @@
|
|
102
118
|
|
103
119
|
### 2024-11-14 (2.8.2)
|
104
120
|
|
105
|
-
* `JSON.load_file`
|
121
|
+
* `JSON.load_file` explicitly read the file as UTF-8.
|
106
122
|
|
107
123
|
### 2024-11-06 (2.8.1)
|
108
124
|
|
@@ -110,7 +126,7 @@
|
|
110
126
|
|
111
127
|
### 2024-11-06 (2.8.0)
|
112
128
|
|
113
|
-
* Emit a deprecation warning when `JSON.load` create custom types without the `create_additions` option being
|
129
|
+
* Emit a deprecation warning when `JSON.load` create custom types without the `create_additions` option being explicitly enabled.
|
114
130
|
* Prefer to use `JSON.unsafe_load(string)` or `JSON.load(string, create_additions: true)`.
|
115
131
|
* Emit a deprecation warning when serializing valid UTF-8 strings encoded in `ASCII_8BIT` aka `BINARY`.
|
116
132
|
* Bump required Ruby version to 2.7.
|
@@ -118,7 +134,7 @@
|
|
118
134
|
pre-existing support for comments, make it suitable to parse `jsonc` documents.
|
119
135
|
* Many performance improvements to `JSON.parse` and `JSON.load`, up to `1.7x` faster on real world documents.
|
120
136
|
* Some minor performance improvements to `JSON.dump` and `JSON.generate`.
|
121
|
-
* `JSON.pretty_generate` no longer
|
137
|
+
* `JSON.pretty_generate` no longer includes newlines inside empty object and arrays.
|
122
138
|
|
123
139
|
### 2024-11-04 (2.7.6)
|
124
140
|
|
@@ -135,13 +151,13 @@
|
|
135
151
|
* Workaround a bug in 3.4.8 and older https://github.com/rubygems/rubygems/pull/6490.
|
136
152
|
This bug would cause some gems with native extension to fail during compilation.
|
137
153
|
* Workaround different versions of `json` and `json_pure` being loaded (not officially supported).
|
138
|
-
* Make `json_pure` Ractor compatible.
|
154
|
+
* Make `json_pure` Ractor compatible.
|
139
155
|
|
140
156
|
### 2024-10-24 (2.7.3)
|
141
157
|
|
142
158
|
* Numerous performance optimizations in `JSON.generate` and `JSON.dump` (up to 2 times faster).
|
143
|
-
* Limit the size of ParserError exception messages, only include up to 32 bytes of the
|
144
|
-
* Fix json-pure's `Object#to_json` to accept non
|
159
|
+
* Limit the size of ParserError exception messages, only include up to 32 bytes of the unparsable source.
|
160
|
+
* Fix json-pure's `Object#to_json` to accept non-state arguments.
|
145
161
|
* Fix multiline comment support in `json-pure`.
|
146
162
|
* Fix `JSON.parse` to no longer mutate the argument encoding when passed an ASCII-8BIT string.
|
147
163
|
* Fix `String#to_json` to raise on invalid encoding in `json-pure`.
|
@@ -286,6 +302,7 @@
|
|
286
302
|
## 2015-09-11 (2.0.0)
|
287
303
|
* Now complies to newest JSON RFC 7159.
|
288
304
|
* Implements compatibility to ruby 2.4 integer unification.
|
305
|
+
* Removed support for `quirks_mode` option.
|
289
306
|
* Drops support for old rubies whose life has ended, that is rubies < 2.0.
|
290
307
|
Also see https://www.ruby-lang.org/en/news/2014/07/01/eol-for-1-8-7-and-1-9-2/
|
291
308
|
* There were still some mentions of dual GPL licensing in the source, but JSON
|
data/lib/json/add/core.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
|
3
|
+
require 'json'
|
4
|
+
end
|
5
|
+
|
6
|
+
class String
|
7
|
+
# call-seq: json_create(o)
|
8
|
+
#
|
9
|
+
# Raw Strings are JSON Objects (the raw bytes are stored in an array for the
|
10
|
+
# key "raw"). The Ruby String can be created by this class method.
|
11
|
+
def self.json_create(object)
|
12
|
+
object["raw"].pack("C*")
|
13
|
+
end
|
14
|
+
|
15
|
+
# call-seq: to_json_raw_object()
|
16
|
+
#
|
17
|
+
# This method creates a raw object hash, that can be nested into
|
18
|
+
# other data structures and will be generated as a raw string. This
|
19
|
+
# method should be used, if you want to convert raw strings to JSON
|
20
|
+
# instead of UTF-8 strings, e. g. binary data.
|
21
|
+
def to_json_raw_object
|
22
|
+
{
|
23
|
+
JSON.create_id => self.class.name,
|
24
|
+
"raw" => unpack("C*"),
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# call-seq: to_json_raw(*args)
|
29
|
+
#
|
30
|
+
# This method creates a JSON text from the result of a call to
|
31
|
+
# to_json_raw_object of this String.
|
32
|
+
def to_json_raw(...)
|
33
|
+
to_json_raw_object.to_json(...)
|
34
|
+
end
|
35
|
+
end
|
data/lib/json/common.rb
CHANGED
@@ -73,7 +73,7 @@ module JSON
|
|
73
73
|
if opts[:create_additions] != false
|
74
74
|
if class_name = object[JSON.create_id]
|
75
75
|
klass = JSON.deep_const_get(class_name)
|
76
|
-
if
|
76
|
+
if klass.respond_to?(:json_creatable?) ? klass.json_creatable? : klass.respond_to?(:json_create)
|
77
77
|
create_additions_warning if create_additions.nil?
|
78
78
|
object = klass.json_create(object)
|
79
79
|
end
|
@@ -97,7 +97,7 @@ module JSON
|
|
97
97
|
|
98
98
|
class << self
|
99
99
|
def deprecation_warning(message, uplevel = 3) # :nodoc:
|
100
|
-
gem_root = File.expand_path("
|
100
|
+
gem_root = File.expand_path("..", __dir__) + "/"
|
101
101
|
caller_locations(uplevel, 10).each do |frame|
|
102
102
|
if frame.path.nil? || frame.path.start_with?(gem_root) || frame.path.end_with?("/truffle/cext_ruby.rb", ".c")
|
103
103
|
uplevel += 1
|
@@ -186,6 +186,25 @@ module JSON
|
|
186
186
|
|
187
187
|
private
|
188
188
|
|
189
|
+
# Called from the extension when a hash has both string and symbol keys
|
190
|
+
def on_mixed_keys_hash(hash, do_raise)
|
191
|
+
set = {}
|
192
|
+
hash.each_key do |key|
|
193
|
+
key_str = key.to_s
|
194
|
+
|
195
|
+
if set[key_str]
|
196
|
+
message = "detected duplicate key #{key_str.inspect} in #{hash.inspect}"
|
197
|
+
if do_raise
|
198
|
+
raise GeneratorError, message
|
199
|
+
else
|
200
|
+
deprecation_warning("#{message}.\nThis will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`")
|
201
|
+
end
|
202
|
+
else
|
203
|
+
set[key_str] = true
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
189
208
|
def deprecated_singleton_attr_accessor(*attrs)
|
190
209
|
args = RUBY_VERSION >= "3.0" ? ", category: :deprecated" : ""
|
191
210
|
attrs.each do |attr|
|
@@ -391,7 +410,7 @@ module JSON
|
|
391
410
|
#
|
392
411
|
# Returns a \String containing the generated \JSON data.
|
393
412
|
#
|
394
|
-
# See also JSON.
|
413
|
+
# See also JSON.pretty_generate.
|
395
414
|
#
|
396
415
|
# Argument +obj+ is the Ruby object to be converted to \JSON.
|
397
416
|
#
|
@@ -643,6 +662,7 @@ module JSON
|
|
643
662
|
# when Array
|
644
663
|
# obj.map! {|v| deserialize_obj v }
|
645
664
|
# end
|
665
|
+
# obj
|
646
666
|
# })
|
647
667
|
# pp ruby
|
648
668
|
# Output:
|
@@ -684,9 +704,13 @@ module JSON
|
|
684
704
|
if opts[:allow_blank] && (source.nil? || source.empty?)
|
685
705
|
source = 'null'
|
686
706
|
end
|
687
|
-
|
688
|
-
|
689
|
-
|
707
|
+
|
708
|
+
if proc
|
709
|
+
opts = opts.dup
|
710
|
+
opts[:on_load] = proc.to_proc
|
711
|
+
end
|
712
|
+
|
713
|
+
parse(source, opts)
|
690
714
|
end
|
691
715
|
|
692
716
|
# :call-seq:
|
@@ -803,6 +827,7 @@ module JSON
|
|
803
827
|
# when Array
|
804
828
|
# obj.map! {|v| deserialize_obj v }
|
805
829
|
# end
|
830
|
+
# obj
|
806
831
|
# })
|
807
832
|
# pp ruby
|
808
833
|
# Output:
|
@@ -1002,7 +1027,7 @@ module JSON
|
|
1002
1027
|
# See {Parsing Options}[#module-JSON-label-Parsing+Options], and {Generating Options}[#module-JSON-label-Generating+Options].
|
1003
1028
|
#
|
1004
1029
|
# For generation, the <tt>strict: true</tt> option is always set. When a Ruby object with no native \JSON counterpart is
|
1005
|
-
#
|
1030
|
+
# encountered, the block provided to the initialize method is invoked, and must return a Ruby object that has a native
|
1006
1031
|
# \JSON counterpart:
|
1007
1032
|
#
|
1008
1033
|
# module MyApp
|
@@ -8,20 +8,8 @@ module JSON
|
|
8
8
|
#
|
9
9
|
# Instantiates a new State object, configured by _opts_.
|
10
10
|
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
# * *indent*: a string used to indent levels (default: ''),
|
14
|
-
# * *space*: a string that is put after, a : or , delimiter (default: ''),
|
15
|
-
# * *space_before*: a string that is put before a : pair delimiter (default: ''),
|
16
|
-
# * *object_nl*: a string that is put at the end of a JSON object (default: ''),
|
17
|
-
# * *array_nl*: a string that is put at the end of a JSON array (default: ''),
|
18
|
-
# * *allow_nan*: true if NaN, Infinity, and -Infinity should be
|
19
|
-
# generated, otherwise an exception is thrown, if these values are
|
20
|
-
# encountered. This options defaults to false.
|
21
|
-
# * *ascii_only*: true if only ASCII characters should be generated. This
|
22
|
-
# option defaults to false.
|
23
|
-
# * *buffer_initial_length*: sets the initial length of the generator's
|
24
|
-
# internal buffer.
|
11
|
+
# Argument +opts+, if given, contains a \Hash of options for the generation.
|
12
|
+
# See {Generating Options}[#module-JSON-label-Generating+Options].
|
25
13
|
def initialize(opts = nil)
|
26
14
|
if opts && !opts.empty?
|
27
15
|
configure(opts)
|
@@ -68,6 +56,11 @@ module JSON
|
|
68
56
|
buffer_initial_length: buffer_initial_length,
|
69
57
|
}
|
70
58
|
|
59
|
+
allow_duplicate_key = allow_duplicate_key?
|
60
|
+
unless allow_duplicate_key.nil?
|
61
|
+
result[:allow_duplicate_key] = allow_duplicate_key
|
62
|
+
end
|
63
|
+
|
71
64
|
instance_variables.each do |iv|
|
72
65
|
iv = iv.to_s[1..-1]
|
73
66
|
result[iv.to_sym] = self[iv]
|
data/lib/json/ext/generator.jar
CHANGED
Binary file
|
data/lib/json/ext/parser.jar
CHANGED
Binary file
|
data/lib/json/generic_object.rb
CHANGED
@@ -52,14 +52,6 @@ module JSON
|
|
52
52
|
table
|
53
53
|
end
|
54
54
|
|
55
|
-
def [](name)
|
56
|
-
__send__(name)
|
57
|
-
end unless method_defined?(:[])
|
58
|
-
|
59
|
-
def []=(name, value)
|
60
|
-
__send__("#{name}=", value)
|
61
|
-
end unless method_defined?(:[]=)
|
62
|
-
|
63
55
|
def |(other)
|
64
56
|
self.class[other.to_hash.merge(to_hash)]
|
65
57
|
end
|
@@ -271,6 +271,12 @@ module JSON
|
|
271
271
|
false
|
272
272
|
end
|
273
273
|
|
274
|
+
if opts.key?(:allow_duplicate_key)
|
275
|
+
@allow_duplicate_key = !!opts[:allow_duplicate_key]
|
276
|
+
else
|
277
|
+
@allow_duplicate_key = nil # nil is deprecation
|
278
|
+
end
|
279
|
+
|
274
280
|
@strict = !!opts[:strict] if opts.key?(:strict)
|
275
281
|
|
276
282
|
if !opts.key?(:max_nesting) # defaults to 100
|
@@ -284,6 +290,10 @@ module JSON
|
|
284
290
|
end
|
285
291
|
alias merge configure
|
286
292
|
|
293
|
+
def allow_duplicate_key? # :nodoc:
|
294
|
+
@allow_duplicate_key
|
295
|
+
end
|
296
|
+
|
287
297
|
# Returns the configuration instance variables as a hash, that can be
|
288
298
|
# passed to the configure method.
|
289
299
|
def to_h
|
@@ -292,6 +302,11 @@ module JSON
|
|
292
302
|
iv = iv.to_s[1..-1]
|
293
303
|
result[iv.to_sym] = self[iv]
|
294
304
|
end
|
305
|
+
|
306
|
+
if result[:allow_duplicate_key].nil?
|
307
|
+
result.delete(:allow_duplicate_key)
|
308
|
+
end
|
309
|
+
|
295
310
|
result
|
296
311
|
end
|
297
312
|
|
@@ -330,8 +345,17 @@ module JSON
|
|
330
345
|
when Hash
|
331
346
|
buf << '{'
|
332
347
|
first = true
|
348
|
+
key_type = nil
|
333
349
|
obj.each_pair do |k,v|
|
334
|
-
|
350
|
+
if first
|
351
|
+
key_type = k.class
|
352
|
+
else
|
353
|
+
if key_type && !@allow_duplicate_key && key_type != k.class
|
354
|
+
key_type = nil # stop checking
|
355
|
+
JSON.send(:on_mixed_keys_hash, obj, !@allow_duplicate_key.nil?)
|
356
|
+
end
|
357
|
+
buf << ','
|
358
|
+
end
|
335
359
|
|
336
360
|
key_str = k.to_s
|
337
361
|
if key_str.class == String
|
@@ -471,11 +495,30 @@ module JSON
|
|
471
495
|
delim = ",#{state.object_nl}"
|
472
496
|
result = +"{#{state.object_nl}"
|
473
497
|
first = true
|
498
|
+
key_type = nil
|
474
499
|
indent = !state.object_nl.empty?
|
475
500
|
each { |key, value|
|
476
|
-
|
501
|
+
if first
|
502
|
+
key_type = key.class
|
503
|
+
else
|
504
|
+
if key_type && !state.allow_duplicate_key? && key_type != key.class
|
505
|
+
key_type = nil # stop checking
|
506
|
+
JSON.send(:on_mixed_keys_hash, self, state.allow_duplicate_key? == false)
|
507
|
+
end
|
508
|
+
result << delim
|
509
|
+
end
|
477
510
|
result << state.indent * depth if indent
|
478
511
|
|
512
|
+
if state.strict? && !(Symbol === key || String === key)
|
513
|
+
if state.as_json
|
514
|
+
key = state.as_json.call(key)
|
515
|
+
end
|
516
|
+
|
517
|
+
unless Symbol === key || String === key
|
518
|
+
raise GeneratorError.new("#{key.class} not allowed as object key in JSON", value)
|
519
|
+
end
|
520
|
+
end
|
521
|
+
|
479
522
|
key_str = key.to_s
|
480
523
|
if key_str.is_a?(String)
|
481
524
|
key_json = key_str.to_json(state)
|
@@ -635,39 +678,6 @@ module JSON
|
|
635
678
|
rescue Encoding::UndefinedConversionError => error
|
636
679
|
raise ::JSON::GeneratorError.new(error.message, self)
|
637
680
|
end
|
638
|
-
|
639
|
-
# Module that holds the extending methods if, the String module is
|
640
|
-
# included.
|
641
|
-
module Extend
|
642
|
-
# Raw Strings are JSON Objects (the raw bytes are stored in an
|
643
|
-
# array for the key "raw"). The Ruby String can be created by this
|
644
|
-
# module method.
|
645
|
-
def json_create(o)
|
646
|
-
o['raw'].pack('C*')
|
647
|
-
end
|
648
|
-
end
|
649
|
-
|
650
|
-
# Extends _modul_ with the String::Extend module.
|
651
|
-
def self.included(modul)
|
652
|
-
modul.extend Extend
|
653
|
-
end
|
654
|
-
|
655
|
-
# This method creates a raw object hash, that can be nested into
|
656
|
-
# other data structures and will be unparsed as a raw string. This
|
657
|
-
# method should be used, if you want to convert raw strings to JSON
|
658
|
-
# instead of UTF-8 strings, e. g. binary data.
|
659
|
-
def to_json_raw_object
|
660
|
-
{
|
661
|
-
JSON.create_id => self.class.name,
|
662
|
-
'raw' => self.unpack('C*'),
|
663
|
-
}
|
664
|
-
end
|
665
|
-
|
666
|
-
# This method creates a JSON text from the result of
|
667
|
-
# a call to to_json_raw_object of this String.
|
668
|
-
def to_json_raw(*args)
|
669
|
-
to_json_raw_object.to_json(*args)
|
670
|
-
end
|
671
681
|
end
|
672
682
|
|
673
683
|
module TrueClass
|
data/lib/json/version.rb
CHANGED
data/lib/json.rb
CHANGED
@@ -133,7 +133,7 @@ require 'json/common'
|
|
133
133
|
# When not specified:
|
134
134
|
# # The last value is used and a deprecation warning emitted.
|
135
135
|
# JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
|
136
|
-
# #
|
136
|
+
# # warning: detected duplicate keys in JSON object.
|
137
137
|
# # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
|
138
138
|
#
|
139
139
|
# When set to `+true+`
|
@@ -307,6 +307,25 @@ require 'json/common'
|
|
307
307
|
#
|
308
308
|
# ---
|
309
309
|
#
|
310
|
+
# Option +allow_duplicate_key+ (boolean) specifies whether
|
311
|
+
# hashes with duplicate keys should be allowed or produce an error.
|
312
|
+
# defaults to emit a deprecation warning.
|
313
|
+
#
|
314
|
+
# With the default, (not set):
|
315
|
+
# Warning[:deprecated] = true
|
316
|
+
# JSON.generate({ foo: 1, "foo" => 2 })
|
317
|
+
# # warning: detected duplicate key "foo" in {foo: 1, "foo" => 2}.
|
318
|
+
# # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
|
319
|
+
# # => '{"foo":1,"foo":2}'
|
320
|
+
#
|
321
|
+
# With <tt>false</tt>
|
322
|
+
# JSON.generate({ foo: 1, "foo" => 2 }, allow_duplicate_key: false)
|
323
|
+
# # detected duplicate key "foo" in {foo: 1, "foo" => 2} (JSON::GeneratorError)
|
324
|
+
#
|
325
|
+
# In version 3.0, <tt>false</tt> will become the default.
|
326
|
+
#
|
327
|
+
# ---
|
328
|
+
#
|
310
329
|
# Option +max_nesting+ (\Integer) specifies the maximum nesting depth
|
311
330
|
# in +obj+; defaults to +100+.
|
312
331
|
#
|
@@ -384,6 +403,9 @@ require 'json/common'
|
|
384
403
|
#
|
385
404
|
# == \JSON Additions
|
386
405
|
#
|
406
|
+
# Note that JSON Additions must only be used with trusted data, and is
|
407
|
+
# deprecated.
|
408
|
+
#
|
387
409
|
# When you "round trip" a non-\String object from Ruby to \JSON and back,
|
388
410
|
# you have a new \String, instead of the object you began with:
|
389
411
|
# ruby0 = Range.new(0, 2)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.14.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Daniel Luz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A JSON implementation as a JRuby extension.
|
14
14
|
email: dev+ruby@mernen.com
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- lib/json/add/rational.rb
|
36
36
|
- lib/json/add/regexp.rb
|
37
37
|
- lib/json/add/set.rb
|
38
|
+
- lib/json/add/string.rb
|
38
39
|
- lib/json/add/struct.rb
|
39
40
|
- lib/json/add/symbol.rb
|
40
41
|
- lib/json/add/time.rb
|