jsonschema_rs 0.48.2-x86_64-linux → 0.48.5-x86_64-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: faf3282426348570d068fd9aeb8c4054bfb7837cee5a6a6d319e47600b4ed288
4
- data.tar.gz: 0cdeac8f87717f5a0f38cea90c611de33362d5e85f65bbe205716d337f89a47b
3
+ metadata.gz: 3417e3b4cda357a9aa8bbc352d8c7fe9ad78b7f7fbfa321b9ec52665fd62f04a
4
+ data.tar.gz: 144184f25c1043d38ec25caa61f9dd2c178a0a894352ce1223368ff24c3d6df4
5
5
  SHA512:
6
- metadata.gz: 716666030ae001f1fd35546bfe6eee2e6ca52ee7a86a6d2fe7782de0576f8387d02fe8497178e98855350d564ea0c8a6b8cbee667611f7486c09fe3d539a313b
7
- data.tar.gz: 760604a064bb5260a78110d7966e88aa9d664cf2b3ff0fb8f1839875f92f29c27d7f76174d33603a14d9171dddf6ad9bc9798eecb61a99d96013941d53872935
6
+ metadata.gz: 0e8f9e8f17299ad06a789a8f5f95e974d1bb85dd614a257b4a50426ccad96f93b670ff19b2be5b2f56ddc5334c9891cdbe746e5b37a068d8a6672b5533c503a7
7
+ data.tar.gz: 583eb8544de626164cd4d9dada859418d75b434b4d18f8881c00c81cf553ea5d60e72031ff342854fdcfe92aeb1d58dbe086f2be15cb9324cf5468fea576f132
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.48.5] - 2026-07-22
6
+
7
+ ### Performance
8
+
9
+ - Avoid map lookups in some `properties` validators.
10
+ - Faster validation of `{"type": "array", "items": {...}}` schemas.
11
+
5
12
  ## [0.48.2] - 2026-07-21
6
13
 
7
14
  ### Fixed
@@ -192,7 +199,8 @@
192
199
 
193
200
  - Initial public release
194
201
 
195
- [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.2...HEAD
202
+ [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.5...HEAD
203
+ [0.48.5]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.2...ruby-v0.48.5
196
204
  [0.48.2]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.1...ruby-v0.48.2
197
205
  [0.48.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.48.0...ruby-v0.48.1
198
206
  [0.48.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.47.0...ruby-v0.48.0
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.2"
4
+ VERSION = "0.48.5"
5
5
  end
data/sig/jsonschema.rbs CHANGED
@@ -14,8 +14,110 @@ module JSONSchema
14
14
  # Main use case: deduplicate equivalent JSON Schemas by using a stable string form.
15
15
  def self.to_string: (untyped object) -> String
16
16
  end
17
+
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
21
+
22
+ type view = TrueView | FalseView | MultiTypeView | TypedGroupView | StringView
23
+ | IntegerView | AnyOfView | ConstView | EnumView | RawView
24
+
25
+ class CanonicalizationError < StandardError
26
+ end
27
+
28
+ class InvalidSchemaType < CanonicalizationError
29
+ end
30
+
31
+ # A schema reduced to canonical form: schemas accepting the same values share one form.
32
+ class CanonicalSchema
33
+ def to_json_schema: () -> untyped
34
+ def draft: () -> JSONSchema::draft
35
+ def kind: () -> kind
36
+ def view: () -> view
37
+ def definitions: () -> Hash[String, CanonicalSchema]
38
+ def satisfiable?: () -> bool
39
+ def inspect: () -> String
40
+ def ==: (untyped other) -> bool
41
+ def eql?: (untyped other) -> bool
42
+ def hash: () -> Integer
43
+ end
44
+
45
+ # Matches any value.
46
+ class TrueView
47
+ end
48
+
49
+ # Matches no value.
50
+ class FalseView
51
+ end
52
+
53
+ # A value matches iff its JSON type is in the set.
54
+ class MultiTypeView
55
+ def types: () -> Array[Symbol]
56
+ def inspect: () -> String
57
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
58
+ end
59
+
60
+ # A value matches iff its JSON type is `type_name` and it satisfies `body`.
61
+ class TypedGroupView
62
+ def type_name: () -> Symbol
63
+ def body: () -> CanonicalSchema
64
+ def inspect: () -> String
65
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
66
+ end
67
+
68
+ # A string value within a length window, matching every pattern.
69
+ class StringView
70
+ def min_length: () -> Integer?
71
+ def max_length: () -> Integer?
72
+ def patterns: () -> Array[String]
73
+ def inspect: () -> String
74
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
75
+ end
76
+
77
+ # An integer value within a closed interval.
78
+ class IntegerView
79
+ def minimum: () -> Integer?
80
+ def maximum: () -> Integer?
81
+ def inspect: () -> String
82
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
83
+ end
84
+
85
+ # A value matches iff at least one branch matches.
86
+ class AnyOfView
87
+ def branches: () -> Array[CanonicalSchema]
88
+ def inspect: () -> String
89
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
90
+ end
91
+
92
+ # Exactly one admitted value.
93
+ class ConstView
94
+ def value: () -> untyped
95
+ def inspect: () -> String
96
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
97
+ end
98
+
99
+ # A sorted, deduplicated finite set of admitted values.
100
+ class EnumView
101
+ def values: () -> Array[untyped]
102
+ def inspect: () -> String
103
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
104
+ end
105
+
106
+ # A schema the canonical form does not model structurally, kept verbatim.
107
+ class RawView
108
+ def schema: () -> untyped
109
+ def inspect: () -> String
110
+ def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
111
+ end
17
112
  end
18
113
 
114
+ # Reduce a schema to its canonical form.
115
+ def self.canonicalize: (
116
+ untyped schema,
117
+ ?draft: draft?,
118
+ ?validate_formats: bool?
119
+ ) -> Canonical::CanonicalSchema
120
+
19
121
  # Create a validator with auto-detected draft version.
20
122
  #
21
123
  # @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.48.2
4
+ version: 0.48.5
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Dmitry Dygalo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-20 00:00:00.000000000 Z
11
+ date: 2026-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal