jsonschema_rs 0.46.10-x86_64-linux → 0.47.0-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: 3ec1d6143eb3a20998a7af7604a726ec87149287a20dbedce52c0e46d538b784
4
- data.tar.gz: ec898777d01d26655366c121f9a5ccb268dba642d2889a53d9d17890381bd5e8
3
+ metadata.gz: 020ef0dda8279e5a5304ad8aa50d6dd2e9e9cc5ff861a672d140d5c306e21027
4
+ data.tar.gz: 6ba21ba4ba488884519eeb3a31bc291ac073cdbb04dd741fd7808898f4701976
5
5
  SHA512:
6
- metadata.gz: 9d74539c8bb000d121ea769d602aa816f4031a7894920c1811b87674f16430d6e46666d6fc29a60bfb2f80d1b81ec4b27fb3255761d1d468c66f88362d861727
7
- data.tar.gz: e9efa4ad9261a0f089ac2cccbc590e84d494ff19fa2beda9af88feb2efa1be031dc2c7054f538688961a19514c931e52de146c6aa4f29dce1fe80d14e9684a60
6
+ metadata.gz: d1ef719d585aea1099503a7db68685828bc20f4da720a2c8c7a499210f5a4a4a1944facb4429dce1d9774f6694790a6821bd39023dfb8afaa38f4ba77ea10e99
7
+ data.tar.gz: 3436c68fe289feb44aa534bc025a6fe9068962edefa9f4ec139ec60d2064c6acfb2ab9460b328d376629bc4f7175c3ee08d0c10f51aeca619c19e726e7b47519
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.47.0] - 2026-07-08
6
+
7
+ ### Added
8
+
9
+ - Optional `iter_errors(instance)` method on custom keyword validators for reporting multiple errors from a single keyword. [#1071](https://github.com/Stranger6667/jsonschema/discussions/1071)
10
+
11
+ ### Performance
12
+
13
+ - Faster validator construction, via compile-time meta-schema validators.
14
+
15
+ ### Fixed
16
+
17
+ - `type` under `items` asserted with the Validation vocabulary disabled.
18
+ - Disabled vocabularies ignored for `$ref` targets without their own `$schema` (e.g. `$defs` entries).
19
+
5
20
  ## [0.46.10] - 2026-07-05
6
21
 
7
22
  ### Fixed
@@ -149,7 +164,8 @@
149
164
 
150
165
  - Initial public release
151
166
 
152
- [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.46.10...HEAD
167
+ [Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.47.0...HEAD
168
+ [0.47.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.46.10...ruby-v0.47.0
153
169
  [0.46.10]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.46.9...ruby-v0.46.10
154
170
  [0.46.9]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.46.8...ruby-v0.46.9
155
171
  [0.46.8]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.46.7...ruby-v0.46.8
data/README.md CHANGED
@@ -148,7 +148,26 @@ Each custom keyword class must implement:
148
148
  - `initialize(parent_schema, value, schema_path)` - called during schema compilation
149
149
  - `validate(instance)` - raise on failure, return normally on success
150
150
 
151
- When `validate` raises, the original exception is preserved as the `cause` of the `ValidationError`, so callers can inspect it:
151
+ A class may also implement `iter_errors(instance)`, returning an array of exceptions, to report several problems from one keyword. `each_error` then surfaces each of them; when the method is absent it falls back to the single error from `validate`:
152
+
153
+ ```ruby
154
+ class AllPositive
155
+ def initialize(parent_schema, value, schema_path); end
156
+
157
+ def validate(instance)
158
+ first_error = iter_errors(instance).first
159
+ raise first_error if first_error
160
+ end
161
+
162
+ def iter_errors(instance)
163
+ return [] unless instance.is_a?(Array)
164
+ instance.each_index.select { |i| instance[i].negative? }
165
+ .map { |i| ArgumentError.new("item #{i} is negative") }
166
+ end
167
+ end
168
+ ```
169
+
170
+ When `validate` raises, the original exception is preserved as the `cause` of the `ValidationError`, so callers can inspect it (errors from `iter_errors` keep their exception as `cause` in the same way):
152
171
 
153
172
  ```ruby
154
173
  begin
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.46.10"
4
+ VERSION = "0.47.0"
5
5
  end
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.46.10
4
+ version: 0.47.0
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-05 00:00:00.000000000 Z
11
+ date: 2026-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal