jsonschema_rs 0.46.10-x86_64-darwin → 0.47.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 +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +20 -1
- data/lib/jsonschema/3.3/jsonschema_rb.bundle +0 -0
- data/lib/jsonschema/3.4/jsonschema_rb.bundle +0 -0
- data/lib/jsonschema/4.0/jsonschema_rb.bundle +0 -0
- data/lib/jsonschema/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 848fd45a694237e8023f18feb73d043c734503e576f6d6bcde5a3cbf159a5148
|
|
4
|
+
data.tar.gz: 49645dda1b63774416dea9768508ca424c5f3796c3913ef586cd53af56493402
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8aa79eabd98af04c300853ebb39c8c0fb2423dfea25362a755e0d9c54851e948234a1c8e79ef3cde28f161006d0194f6a9330ef1578eb175302fa9d463d869bb
|
|
7
|
+
data.tar.gz: ab74cd1bdbcf3fb60886129acc162197378d11f662463de3884c9d4651a57e48624f16fc9adfb7abeb04ca1dc668790f03d11125c40f4ec2bf7c68ce33cd8694
|
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.
|
|
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
|
-
|
|
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
|
data/lib/jsonschema/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.47.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-07-
|
|
11
|
+
date: 2026-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bigdecimal
|