jsonschema_rs 0.43.0-x86_64-darwin → 0.44.0-x86_64-darwin

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: 7b0c05b8417e38e3b90d55a53f4cc8d38c205cc03f9dabf1059ae975252a7fdd
4
- data.tar.gz: 79e67f4d00fe085b5f94ce6b1291d9410324631ff85ad386d5330b4e7a2efc21
3
+ metadata.gz: a24ca84a5d46d3cdbd55836f2ba06cdc8646ef86f6223c32a4987b0c39a5cdd8
4
+ data.tar.gz: 2cf2460de2339afa8d94d2e0bd7d59442bf2918680a2047efde84517c3ad5674
5
5
  SHA512:
6
- metadata.gz: 35628014e944947770ef20120f6fd6914431d63e7388defeac88a87881388b35688c0e36e3edce5bc4fbb70de8af4229115f9f5e13f5ce39d8cd853cd59f72bb
7
- data.tar.gz: 9c11f60b7ee9c9f5ddd5f653f6b24c7ef33da925f37664c0a1590564c93ce1a5151c9481b6edfc797f590f99a17575675f856e8bb5ea75a10c691ffe49b0ab8b
6
+ metadata.gz: 18438841ff65a73f01946bff20e20a0617ab7caf85066c43b44971bbf9a8d024f1d9f6ad968ea4557bcacf9c7db4f541080441a903dc589af3810670185d68f8
7
+ data.tar.gz: 5c461fe71312e305d6f6be2d0750e20832d9725d1b633dfac66f1e8fc43008f9a1e3e0b1351c41cc9de1619cddc092a3db78cd4a3248d2f0f2a1a2b2e3cc969d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.44.0] - 2026-03-02
6
+
7
+ ### Added
8
+
9
+ - `Canonical::JSON.to_string(object)` for canonical JSON serialization (stable key ordering and numeric normalization), useful for deduplicating equivalent JSON Schemas.
10
+
11
+ ### Fixed
12
+
13
+ - Do not produce annotations for non-string instances from `contentMediaType`, `contentEncoding`, and `contentSchema` keywords.
14
+
5
15
  ## [0.43.0] - 2026-02-28
6
16
 
7
17
  ### Added
@@ -43,7 +53,8 @@
43
53
 
44
54
  - Initial public release
45
55
 
46
- [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.43.0...HEAD
56
+ [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.44.0...HEAD
57
+ [0.44.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.43.0...ruby-v0.44.0
47
58
  [0.43.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.42.2...ruby-v0.43.0
48
59
  [0.42.2]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.42.1...ruby-v0.42.2
49
60
  [0.42.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.42.0...ruby-v0.42.1
data/README.md CHANGED
@@ -251,6 +251,22 @@ valid_eval.annotations
251
251
  # instanceLocation: "", annotations: ["age", "name"]}]
252
252
  ```
253
253
 
254
+ ### Canonical JSON serialization
255
+
256
+ Use `Canonical::JSON.to_string` when you need a stable JSON representation:
257
+
258
+ ```ruby
259
+ schema_a = { "type" => "object", "properties" => { "b" => { "type" => "integer" }, "a" => { "type" => "string" } } }
260
+ schema_b = { "properties" => { "a" => { "type" => "string" }, "b" => { "type" => "integer" } }, "type" => "object" }
261
+
262
+ dump_a = JSONSchema::Canonical::JSON.to_string(schema_a)
263
+ dump_b = JSONSchema::Canonical::JSON.to_string(schema_b)
264
+
265
+ dump_a == dump_b # => true
266
+ ```
267
+
268
+ Main use case: deduplicating equivalent JSON Schemas.
269
+
254
270
  ## Meta-Schema Validation
255
271
 
256
272
  Validate that a JSON Schema document is itself valid:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSONSchema
4
- VERSION = "0.43.0"
4
+ VERSION = "0.44.0"
5
5
  end
data/sig/jsonschema.rbs CHANGED
@@ -7,6 +7,15 @@ module JSONSchema
7
7
  # Valid draft version symbols
8
8
  type draft = :draft4 | :draft6 | :draft7 | :draft201909 | :draft202012
9
9
 
10
+ module Canonical
11
+ module JSON
12
+ # Serialize a Ruby value to canonical JSON.
13
+ #
14
+ # Main use case: deduplicate equivalent JSON Schemas by using a stable string form.
15
+ def self.to_string: (untyped object) -> String
16
+ end
17
+ end
18
+
10
19
  # Create a validator with auto-detected draft version.
11
20
  #
12
21
  # @param schema The JSON Schema (Hash or JSON string)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonschema_rs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Dmitry Dygalo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-28 00:00:00.000000000 Z
11
+ date: 2026-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal