jsonschema_rs 0.48.5 → 0.49.0

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: 60ae1d2ffaa7543f17f5a7953a2ed92520f3887f7e92c8c8ac632f7c56e515ef
4
- data.tar.gz: 8c3ac5d3f66016a881eed8a6f9f78327e32373e738ab453c39f0449365fce8a9
3
+ metadata.gz: 5089bd59db447c9dd706a0fcaf832dac6832d5be6662e988b7a386c8cd31e6b0
4
+ data.tar.gz: ed3f7c83e18c5b8eea755a6a814106693ac729a11325946e878daca82afa0a32
5
5
  SHA512:
6
- metadata.gz: 3878552e31d235939c2fc5f4a7665002fa7ee604d4fed06a899ea78679b5ea76183322524b828376e5d891c154426a2fb1167604444eefcb8509afda8b477501
7
- data.tar.gz: 9e6c6b67a2d3bea2ce93c31c1da0947832708ee55941950860ace90959ad4eb1d66c31e6a66273d17a3bd567f6fec739046c7b18deb6335e326cddfaab5fcdf1
6
+ metadata.gz: f15778547054d8aa3e988d34db28fa5144ed87821f4be792120366dc93ff3f2ae908f64610e72047f111f10617187ea6d0debd859be1cb5de11756af8bf874a0
7
+ data.tar.gz: 5d9f288ab525665571492a9e6a8f7846b01dc07f78cee128a998777edcfcb2fb8977dcab97735c4bbbb1634f6f3e350904ec9c1d4e1d987de3c86fefc030f24b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.49.0] - 2026-07-25
6
+
7
+ ### Added
8
+
9
+ - **EXPERIMENTAL**: Schema canonicalization via `jsonschema::canonicalize`. It reduces a reasonable subset of JSON Schemas to their normal forms.
10
+ - Validation of recursive Ruby objects.
11
+
12
+ ### Changed
13
+
14
+ - Invalid UTF-8, unsupported types, and nesting past the depth limit are reported only where a keyword reads the value.
15
+ - A hash keyed by both `:name` and `"name"` counts two properties (it previously collapsed them into one).
16
+
17
+ ### Fixed
18
+
19
+ - `multipleOf` incorrectly accepted integers past `u64` that are not multiples of the divisor.
20
+
21
+ ### Performance
22
+
23
+ - Up to 3x faster validation by working on Ruby objects directly instead of converting them to `serde_json`. [#239](https://github.com/Stranger6667/jsonschema/issues/239)
24
+
5
25
  ## [0.48.5] - 2026-07-22
6
26
 
7
27
  ### Performance
@@ -199,7 +219,8 @@
199
219
 
200
220
  - Initial public release
201
221
 
202
- [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.5...HEAD
222
+ [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.49.0...HEAD
223
+ [0.49.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.5...ruby-v0.49.0
203
224
  [0.48.5]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.2...ruby-v0.48.5
204
225
  [0.48.2]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.1...ruby-v0.48.2
205
226
  [0.48.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.0...ruby-v0.48.1
data/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "jsonschema-rb"
3
- version = "0.48.5"
3
+ version = "0.49.0"
4
4
  edition = "2021"
5
5
  authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
6
6
  license = "MIT"
@@ -13,7 +13,7 @@ publish = false
13
13
  crate-type = ["cdylib"]
14
14
 
15
15
  [dependencies]
16
- jsonschema = { version = "0.48.5", default-features = false, features = ["arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros"] }
16
+ jsonschema = { version = "0.49.0", default-features = false, features = ["magnus", "arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros"] }
17
17
  magnus = { version = "0.8", features = ["rb-sys"] }
18
18
  rb-sys = "0.9"
19
19
  serde = { workspace = true }
@@ -693,9 +693,9 @@ dependencies = [
693
693
 
694
694
  [[package]]
695
695
  name = "jsonschema"
696
- version = "0.48.5"
696
+ version = "0.49.0"
697
697
  source = "registry+https://github.com/rust-lang/crates.io-index"
698
- checksum = "f05a6cff806294a7699d48761d4ae2bdebab7fa2eef05e4a0b83320f0ff46901"
698
+ checksum = "9eb9cf6891f8d15a89f7bcf8e812a62efef1fd8d9e7e4522f455875a1224875a"
699
699
  dependencies = [
700
700
  "ahash",
701
701
  "bytecount",
@@ -726,9 +726,9 @@ dependencies = [
726
726
 
727
727
  [[package]]
728
728
  name = "jsonschema-macros"
729
- version = "0.48.5"
729
+ version = "0.49.0"
730
730
  source = "registry+https://github.com/rust-lang/crates.io-index"
731
- checksum = "40bda6e08b09b66cc0f70c0768118b51e8da7cef847036c88a68471b15101bcb"
731
+ checksum = "78fac461293b8d5484a845adbbfaa263ae76616ceae93283baaa4621736f9c54"
732
732
  dependencies = [
733
733
  "jsonschema-macros-core",
734
734
  "proc-macro2",
@@ -736,9 +736,9 @@ dependencies = [
736
736
 
737
737
  [[package]]
738
738
  name = "jsonschema-macros-core"
739
- version = "0.48.5"
739
+ version = "0.49.0"
740
740
  source = "registry+https://github.com/rust-lang/crates.io-index"
741
- checksum = "5f884bf73113c53f6b1d23f14c68a09faebf118854ce122a1afe91ce73d050d3"
741
+ checksum = "937a50f77ead02f355faec45d36f0b739da183857002af4f3a2759451dc9aec3"
742
742
  dependencies = [
743
743
  "fancy-regex",
744
744
  "indexmap",
@@ -755,7 +755,7 @@ dependencies = [
755
755
 
756
756
  [[package]]
757
757
  name = "jsonschema-rb-ext"
758
- version = "0.48.5"
758
+ version = "0.49.0"
759
759
  dependencies = [
760
760
  "jsonschema",
761
761
  "magnus",
@@ -768,25 +768,27 @@ dependencies = [
768
768
 
769
769
  [[package]]
770
770
  name = "jsonschema-regex"
771
- version = "0.48.5"
771
+ version = "0.49.0"
772
772
  source = "registry+https://github.com/rust-lang/crates.io-index"
773
- checksum = "84708dd3f6c5327478a96f37378adb27deed6a626cf84d19de780d9e8ae84b17"
773
+ checksum = "b70811da032e736899c5045ee30f069ba241676739e6ed042c1f9ddd3ad47cde"
774
774
  dependencies = [
775
775
  "regex-syntax",
776
776
  ]
777
777
 
778
778
  [[package]]
779
779
  name = "jsonschema-value"
780
- version = "0.48.5"
780
+ version = "0.49.0"
781
781
  source = "registry+https://github.com/rust-lang/crates.io-index"
782
- checksum = "fd8c04ab4ce60e42c4e302d3bd9d184652bb56f212495d2eea23573bcbf72556"
782
+ checksum = "5ceacf7ad8e9a1f6229a1354dc0ab238855623d219b6abf0a001c138241ec530"
783
783
  dependencies = [
784
784
  "ahash",
785
785
  "bytecount",
786
786
  "fraction",
787
+ "magnus",
787
788
  "num-bigint",
788
789
  "num-cmp",
789
790
  "num-traits",
791
+ "rb-sys",
790
792
  "serde_json",
791
793
  ]
792
794
 
@@ -1130,9 +1132,9 @@ dependencies = [
1130
1132
 
1131
1133
  [[package]]
1132
1134
  name = "referencing"
1133
- version = "0.48.5"
1135
+ version = "0.49.0"
1134
1136
  source = "registry+https://github.com/rust-lang/crates.io-index"
1135
- checksum = "980e77f5cfffc592c0e7dfb6d20770a0b96a6ab94d403de7454ed9799505e4ba"
1137
+ checksum = "cbded44c4882a15738bd1bba376609f679292d758c0b3c389a2ef4a0ea6ce9b7"
1136
1138
  dependencies = [
1137
1139
  "ahash",
1138
1140
  "fluent-uri",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "jsonschema-rb-ext"
3
- version = "0.48.5"
3
+ version = "0.49.0"
4
4
  edition = "2021"
5
5
  publish = false
6
6
 
@@ -10,10 +10,10 @@ name = "jsonschema_rb"
10
10
  path = "../../src/lib.rs"
11
11
 
12
12
  [dependencies]
13
- jsonschema = { version = "0.48.5", default-features = false, features = ["arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros"] }
13
+ jsonschema = { version = "0.49.0", default-features = false, features = ["magnus", "arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros"] }
14
14
  magnus = { version = "0.8", features = ["rb-sys"] }
15
15
  rb-sys = "0.9"
16
- referencing = "0.48.5"
16
+ referencing = "0.49.0"
17
17
  serde = { version = "1", features = ["derive"] }
18
18
  serde_json = { version = "1", features = ["arbitrary_precision"] }
19
19
  zmij = "1"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSONSchema
4
- VERSION = "0.48.5"
4
+ VERSION = "0.49.0"
5
5
  end
data/sig/jsonschema.rbs CHANGED
@@ -16,11 +16,12 @@ module JSONSchema
16
16
  end
17
17
 
18
18
  # Structural discriminant of a canonical schema, one per view class.
19
- type kind = :multi_type | :typed_group | :string | :integer | :const | :enum
20
- | :any_of | :true | :false | :raw
19
+ type kind = :multi_type | :typed_group | :string | :integer | :number | :array
20
+ | :object | :const | :enum | :any_of | :true | :false | :raw
21
21
 
22
22
  type view = TrueView | FalseView | MultiTypeView | TypedGroupView | StringView
23
- | IntegerView | AnyOfView | ConstView | EnumView | RawView
23
+ | IntegerView | NumberView | ArrayView | ObjectView | AnyOfView
24
+ | ConstView | EnumView | RawView
24
25
 
25
26
  class CanonicalizationError < StandardError
26
27
  end
@@ -70,14 +71,62 @@ module JSONSchema
70
71
  def min_length: () -> Integer?
71
72
  def max_length: () -> Integer?
72
73
  def patterns: () -> Array[String]
74
+ def formats: () -> Array[String]
75
+ def content_media_types: () -> Array[String]
76
+ def content_encodings: () -> Array[String]
73
77
  def inspect: () -> String
74
78
  def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
75
79
  end
76
80
 
77
- # An integer value within a closed interval.
81
+ # A number value within a real interval.
82
+ class NumberView
83
+ def minimum: () -> (Integer | Float)?
84
+ def exclusive_minimum: () -> bool
85
+ def maximum: () -> (Integer | Float)?
86
+ def exclusive_maximum: () -> bool
87
+ def multiple_of: () -> Array[Integer | Float]
88
+ def inspect: () -> String
89
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
90
+ end
91
+
92
+ # An integer value within a closed interval, optionally a multiple of a divisor.
78
93
  class IntegerView
79
94
  def minimum: () -> Integer?
80
95
  def maximum: () -> Integer?
96
+ def multiple_of: () -> Array[Integer | Float]
97
+ def inspect: () -> String
98
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
99
+ end
100
+
101
+ # An array value whose length is within a window.
102
+ class ArrayView
103
+ def min_items: () -> Integer?
104
+ def max_items: () -> Integer?
105
+ def unique_items: () -> bool
106
+ def prefix_items: () -> Array[CanonicalSchema]
107
+ def items: () -> CanonicalSchema?
108
+ def contains: () -> Array[ContainsView]
109
+ def inspect: () -> String
110
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
111
+ end
112
+
113
+ # One `contains` demand of an array; an absent minimum spells the default of one.
114
+ class ContainsView
115
+ def schema: () -> CanonicalSchema
116
+ def min_contains: () -> Integer?
117
+ def max_contains: () -> Integer?
118
+ def inspect: () -> String
119
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
120
+ end
121
+
122
+ # An object value whose property count is within a window.
123
+ class ObjectView
124
+ def min_properties: () -> Integer?
125
+ def max_properties: () -> Integer?
126
+ def required: () -> Array[String]
127
+ def property_names: () -> CanonicalSchema?
128
+ def properties: () -> Hash[String, CanonicalSchema]
129
+ def pattern_properties: () -> Hash[String, CanonicalSchema]
81
130
  def inspect: () -> String
82
131
  def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
83
132
  end