jsonschema_rs 0.48.5-aarch64-linux → 0.49.1-aarch64-linux

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: cf692a11080432d9a25f6147700f9f66a4208d6d274871feac46adb3d3c13abe
4
- data.tar.gz: 7df41808ba9b11907bc566000f5f1362b9630967a33aedafea040bb099d2167e
3
+ metadata.gz: 6c086b32fb095d852a4dce8b5702ec27d8d45f30e12d85f7c36738bd41e5028e
4
+ data.tar.gz: 31b1fb96af0203959de7570c575f2b368d21e9044f6c8c9b922d7f6c664037d4
5
5
  SHA512:
6
- metadata.gz: df8d7658947842bb585c6284b822acf7fbb610914b2fab5e53924562ce452544f1aeae2fe7274c18f48f796ded95c10e93349ae461fdd21f3289c04f34ba7834
7
- data.tar.gz: ed26651082b8426ed286098aa90ae06fd6a9afb16bdc2948b651cef1b94d667165e99e28d8074a4dd0758504c52dc21d7753d3dc2161b1da3e51cfd40190831d
6
+ metadata.gz: '049fc0131f88ce533c9d72817925df9e98d37fedbbbdb2b6499e847d10c0cfdff7b561aaee86043ca8937ed83c546ff53171161d4049f700e9189219f8f49134'
7
+ data.tar.gz: e8c39bdd2b4c4b631c63805a06c17735b9193d7bba24b02ddffc7f626349e2e9205e7fe6151d15c7cf99e6618ab12255f31542c519c0c88eac792b3501e77e19
data/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.49.1] - 2026-07-25
6
+
7
+ ### Fixed
8
+
9
+ - `JSONSchema.canonicalize` rejecting `pattern_options` (it should take the same regex configuration as validators).
10
+ - `InvalidPattern` failures raising the base `CanonicalizationError` (they should raise `JSONSchema::Canonical::InvalidPattern`).
11
+
12
+ ## [0.49.0] - 2026-07-25
13
+
14
+ ### Added
15
+
16
+ - **EXPERIMENTAL**: Schema canonicalization via `jsonschema::canonicalize`. It reduces a reasonable subset of JSON Schemas to their normal forms.
17
+ - Validation of recursive Ruby objects.
18
+
19
+ ### Changed
20
+
21
+ - Invalid UTF-8, unsupported types, and nesting past the depth limit are reported only where a keyword reads the value.
22
+ - A hash keyed by both `:name` and `"name"` counts two properties (it previously collapsed them into one).
23
+
24
+ ### Fixed
25
+
26
+ - `multipleOf` incorrectly accepted integers past `u64` that are not multiples of the divisor.
27
+
28
+ ### Performance
29
+
30
+ - 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)
31
+
5
32
  ## [0.48.5] - 2026-07-22
6
33
 
7
34
  ### Performance
@@ -199,7 +226,9 @@
199
226
 
200
227
  - Initial public release
201
228
 
202
- [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.5...HEAD
229
+ [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.49.1...HEAD
230
+ [0.49.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.49.0...ruby-v0.49.1
231
+ [0.49.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.5...ruby-v0.49.0
203
232
  [0.48.5]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.2...ruby-v0.48.5
204
233
  [0.48.2]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.1...ruby-v0.48.2
205
234
  [0.48.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.0...ruby-v0.48.1
Binary file
Binary file
Binary file
@@ -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.1"
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
@@ -28,6 +29,9 @@ module JSONSchema
28
29
  class InvalidSchemaType < CanonicalizationError
29
30
  end
30
31
 
32
+ class InvalidPattern < CanonicalizationError
33
+ end
34
+
31
35
  # A schema reduced to canonical form: schemas accepting the same values share one form.
32
36
  class CanonicalSchema
33
37
  def to_json_schema: () -> untyped
@@ -70,14 +74,62 @@ module JSONSchema
70
74
  def min_length: () -> Integer?
71
75
  def max_length: () -> Integer?
72
76
  def patterns: () -> Array[String]
77
+ def formats: () -> Array[String]
78
+ def content_media_types: () -> Array[String]
79
+ def content_encodings: () -> Array[String]
80
+ def inspect: () -> String
81
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
82
+ end
83
+
84
+ # A number value within a real interval.
85
+ class NumberView
86
+ def minimum: () -> (Integer | Float)?
87
+ def exclusive_minimum: () -> bool
88
+ def maximum: () -> (Integer | Float)?
89
+ def exclusive_maximum: () -> bool
90
+ def multiple_of: () -> Array[Integer | Float]
73
91
  def inspect: () -> String
74
92
  def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
75
93
  end
76
94
 
77
- # An integer value within a closed interval.
95
+ # An integer value within a closed interval, optionally a multiple of a divisor.
78
96
  class IntegerView
79
97
  def minimum: () -> Integer?
80
98
  def maximum: () -> Integer?
99
+ def multiple_of: () -> Array[Integer | Float]
100
+ def inspect: () -> String
101
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
102
+ end
103
+
104
+ # An array value whose length is within a window.
105
+ class ArrayView
106
+ def min_items: () -> Integer?
107
+ def max_items: () -> Integer?
108
+ def unique_items: () -> bool
109
+ def prefix_items: () -> Array[CanonicalSchema]
110
+ def items: () -> CanonicalSchema?
111
+ def contains: () -> Array[ContainsView]
112
+ def inspect: () -> String
113
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
114
+ end
115
+
116
+ # One `contains` demand of an array; an absent minimum spells the default of one.
117
+ class ContainsView
118
+ def schema: () -> CanonicalSchema
119
+ def min_contains: () -> Integer?
120
+ def max_contains: () -> Integer?
121
+ def inspect: () -> String
122
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
123
+ end
124
+
125
+ # An object value whose property count is within a window.
126
+ class ObjectView
127
+ def min_properties: () -> Integer?
128
+ def max_properties: () -> Integer?
129
+ def required: () -> Array[String]
130
+ def property_names: () -> CanonicalSchema?
131
+ def properties: () -> Hash[String, CanonicalSchema]
132
+ def pattern_properties: () -> Hash[String, CanonicalSchema]
81
133
  def inspect: () -> String
82
134
  def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
83
135
  end
@@ -115,7 +167,8 @@ module JSONSchema
115
167
  def self.canonicalize: (
116
168
  untyped schema,
117
169
  ?draft: draft?,
118
- ?validate_formats: bool?
170
+ ?validate_formats: bool?,
171
+ ?pattern_options: (RegexOptions | FancyRegexOptions)?
119
172
  ) -> Canonical::CanonicalSchema
120
173
 
121
174
  # Create a validator with auto-detected draft version.
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.48.5
4
+ version: 0.49.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Dmitry Dygalo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-22 00:00:00.000000000 Z
11
+ date: 2026-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal