json 2.17.1-java → 2.18.1-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4be951d5f80cd0c36f47ac90a9b19352b28bc89c10d4395ce295a1bb92d28a7e
4
- data.tar.gz: 933bbc7b8c22634897020ff64ae5dafa076c29c195b36bf3a6fea2fa374862b2
3
+ metadata.gz: 6910de3b175b876dd2565856cdd7df4b04cc96fdb9076709287644b8a3a9748a
4
+ data.tar.gz: 1da208a71639069ec574857a6e134964becd6d580b1196b5403d086372174cef
5
5
  SHA512:
6
- metadata.gz: fe3bfd01c04c677935c6fb0c8c939fd8e938dc48c7b3eb3111491f18c185913b01997e6d53ee8847a093d3a0372b0d84c36b4467ba2524bf3fa214df5d9bc7c0
7
- data.tar.gz: dee22d1160ffbb80b83d2ebe7e2657f1712cd0616d6176391e6a87dbe47471c30ab5995e4553338f3ce48adc7f8b98c6a8946b3ea55b866ce0f9cb5ef35eabe1
6
+ metadata.gz: 10e4ac9a7c71c9fd5576f8971d682b1cb4dda0a5c76ff176907b6be03c4f935b89c098c74cdd6095950377839128dda774835641b8d688bff03df1be46f46f87
7
+ data.tar.gz: 5852bba834c3f679f93076f02ade8860e5105f32a4093f3471e807de4fbb97980213feba5f6471a5803bd9400b06aa1d06e0dee5e893e098c474153a0b8cd70c
data/CHANGES.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ ### 2026-02-03 (2.18.1)
6
+
7
+ * Fix a potential crash in very specific circumstance if GC triggers during a call to `to_json`
8
+ without first invoking a user defined `#to_json` method.
9
+
10
+ ### 2025-12-11 (2.18.0)
11
+
12
+ * Add `:allow_control_characters` parser options, to allow JSON strings containing unescaped ASCII control characters (e.g. newlines).
13
+
5
14
  ### 2025-12-04 (2.17.1)
6
15
 
7
16
  * Fix a regression in parsing of unicode surogate pairs (`\uXX\uXX`) that could cause an invalid string to be returned.
@@ -62,7 +71,7 @@
62
71
  * Fix `JSON.generate` `strict: true` mode to also restrict hash keys.
63
72
  * Fix `JSON::Coder` to also invoke block for hash keys that aren't strings nor symbols.
64
73
  * Fix `JSON.unsafe_load` usage with proc
65
- * Fix the parser to more consistently reject invalid UTF-16 surogate pairs.
74
+ * Fix the parser to more consistently reject invalid UTF-16 surogate pairs.
66
75
  * Stop defining `String.json_create`, `String#to_json_raw`, `String#to_json_raw_object` when `json/add` isn't loaded.
67
76
 
68
77
  ### 2025-07-28 (2.13.2)
Binary file
Binary file
@@ -500,11 +500,6 @@ module JSON
500
500
 
501
501
  private
502
502
 
503
- def json_shift(state)
504
- state.object_nl.empty? or return ''
505
- state.indent * state.depth
506
- end
507
-
508
503
  def json_transform(state)
509
504
  depth = state.depth += 1
510
505
 
data/lib/json/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSON
4
- VERSION = '2.17.1'
4
+ VERSION = '2.18.1'
5
5
  end
data/lib/json.rb CHANGED
@@ -6,6 +6,15 @@ require 'json/common'
6
6
  #
7
7
  # \JSON is a lightweight data-interchange format.
8
8
  #
9
+ # \JSON is easy for us humans to read and write,
10
+ # and equally simple for machines to read (parse) and write (generate).
11
+ #
12
+ # \JSON is language-independent, making it an ideal interchange format
13
+ # for applications in differing programming languages
14
+ # and on differing operating systems.
15
+ #
16
+ # == \JSON Values
17
+ #
9
18
  # A \JSON value is one of the following:
10
19
  # - Double-quoted text: <tt>"foo"</tt>.
11
20
  # - Number: +1+, +1.0+, +2.0e2+.
@@ -173,6 +182,18 @@ require 'json/common'
173
182
  # When enabled:
174
183
  # JSON.parse('[1,]', allow_trailing_comma: true) # => [1]
175
184
  #
185
+ # ---
186
+ #
187
+ # Option +allow_control_characters+ (boolean) specifies whether to allow
188
+ # unescaped ASCII control characters, such as newlines, in strings;
189
+ # defaults to +false+.
190
+ #
191
+ # With the default, +false+:
192
+ # JSON.parse(%{"Hello\nWorld"}) # invalid ASCII control character in string (JSON::ParserError)
193
+ #
194
+ # When enabled:
195
+ # JSON.parse(%{"Hello\nWorld"}, allow_control_characters: true) # => "Hello\nWorld"
196
+ #
176
197
  # ====== Output Options
177
198
  #
178
199
  # Option +freeze+ (boolean) specifies whether the returned objects will be frozen;
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.17.1
4
+ version: 2.18.1
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-12-04 00:00:00.000000000 Z
11
+ date: 2026-02-03 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