json 2.15.1-java → 2.15.2-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: c9c9f896105222f17d7561710f916b6dd6ceb760e3d9ac17a778159954a3cd4d
4
- data.tar.gz: 551c43c7e7f71d3c849d4b6af1a3542665b21732e2f5114631163d789cde7c92
3
+ metadata.gz: 48d22171870875f79dc860de151f8ad1ca9b3658d70ba4b12b8eb303221108fa
4
+ data.tar.gz: f2a4754a3852a4791e3a62fce1966f613fe0167f0cb8748491922e4ddeab170f
5
5
  SHA512:
6
- metadata.gz: eb15c44e7a4372de8f9aed4ec69f4070bffdd9311e32606b91d81b3326ff343e5d64d5346f3a604be0f83ce623ba13d45ea63ace209ba9bc47f758dcc7d8e05f
7
- data.tar.gz: a9c67ce3cdc6faf65fc8467d043bf9907d58933bdff9131b184ee29d735277a88d597846c04bcbe1ae3e2990aca62c8b19e6b90307c16bdd69b7b2b863166b29
6
+ metadata.gz: efe4e79202ce017a55d516b2c7f473e63d58c536986130cf68c3f473c9ae8ca819e13d590b79f04b7e845c83425a29b22062bfdeaecd227577b9c56ed94f4e3b
7
+ data.tar.gz: 96da2d6068270a844bd6015ac0e67196c19b6c208f49e7adb71ad610662cce066d5d0dc294582a01153853f2186a03e06d20abbd16d7b6faf83dab05c097d84b
data/CHANGES.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ ### 2025-10-25 (2.15.2)
6
+
7
+ * Fix `JSON::Coder` to have one dedicated depth counter per invocation.
8
+ After encountering a circular reference in `JSON::Coder#dump`, any further `#dump` call would raise `JSON::NestingError`.
9
+
5
10
  ### 2025-10-07 (2.15.1)
6
11
 
7
12
  * Fix incorrect escaping in the JRuby extension when encoding shared strings.
Binary file
Binary file
@@ -212,7 +212,7 @@ module JSON
212
212
  return if @max_nesting.zero?
213
213
  current_nesting = depth + 1
214
214
  current_nesting > @max_nesting and
215
- raise NestingError, "nesting of #{current_nesting} is too deep"
215
+ raise NestingError, "nesting of #{current_nesting} is too deep. Did you try to serialize objects with circular references?"
216
216
  end
217
217
 
218
218
  # Returns true, if circular data structures are checked,
@@ -347,6 +347,10 @@ module JSON
347
347
  dup.generate(obj, anIO)
348
348
  end
349
349
 
350
+ private def initialize_copy(_orig)
351
+ @depth = 0
352
+ end
353
+
350
354
  # Handles @allow_nan, @buffer_initial_length, other ivars must be the default value (see above)
351
355
  private def generate_json(obj, buf)
352
356
  case obj
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.15.1'
4
+ VERSION = '2.15.2'
5
5
  end
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.15.1
4
+ version: 2.15.2
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-10-07 00:00:00.000000000 Z
11
+ date: 2025-10-25 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