jsonschema_rs 0.54.0 → 0.55.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 +4 -4
- data/CHANGELOG.md +22 -1
- data/Cargo.toml +2 -2
- data/ext/jsonschema/Cargo.lock +13 -13
- data/ext/jsonschema/Cargo.toml +3 -3
- data/lib/jsonschema/version.rb +1 -1
- data/sig/jsonschema.rbs +9 -1
- data/src/canonical.rs +59 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05d235bb8d425f0058f6370d39c220a9f740be230a727d15abf8e63a43d2285a
|
|
4
|
+
data.tar.gz: 95c876a4adc6cb3e3d733ada0134dfc74ad318402fdd3ccd9b2564d2f8734bec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8cc6eaab21f6e78cc0a0fceabbf80e6df82862b81f9061d2e8efc1db8d79e7f90fbf843998b0c443cb9c357d2c878a1c6d536ff14e43c4ba156ee10ffe701523
|
|
7
|
+
data.tar.gz: 8909fbf930850898ee73547e1d50b9f6e28180f36dbe27c17298beff54bb6bbab81272422668c7155e48218b2cb1d3d9e8330257622d81a2cae589d60f818eee
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.55.0] - 2026-09-06
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `JSONSchema::Canonical::PatternValueFailsView`, which `ObjectView#violations` records for a `patternProperties` entry.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Canonicalization of `not` over `patternProperties`, which kept the entry under `not` instead of recording the demand a key breaks.
|
|
14
|
+
- Canonicalization of an `anyOf` over objects sharing a `properties` key under `patternProperties`, which settled only on a second pass.
|
|
15
|
+
- Canonicalization of `not` over an `allOf` folded through a reference, which settled only on a second pass.
|
|
16
|
+
- Canonicalization of a `multipleOf` divisor past `f64` precision, which was not taken to divide itself.
|
|
17
|
+
- Canonicalization of an `anyOf` over a value beside a window pinned to it, which settled only on a second pass.
|
|
18
|
+
- Canonicalization of `minProperties: 1` beside a `not` that already demands a key, which settled only on a second pass.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `absolute_keyword_location` naming the sibling keyword whose validator carries the check: `maxLength` beside `minLength`, `minItems`, `maxItems` or `type` beside `items`, and a two-name `required` beside `properties`. [#1579](https://github.com/Stranger6667/jsonschema/issues/1579)
|
|
23
|
+
- `schemaLocation` in `evaluate` output naming `minLength` for a `maxLength` failure. [#1579](https://github.com/Stranger6667/jsonschema/issues/1579)
|
|
24
|
+
|
|
5
25
|
## [0.54.0] - 2026-09-06
|
|
6
26
|
|
|
7
27
|
### Performance
|
|
@@ -525,7 +545,8 @@
|
|
|
525
545
|
|
|
526
546
|
- Initial public release
|
|
527
547
|
|
|
528
|
-
[Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.
|
|
548
|
+
[Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.55.0...HEAD
|
|
549
|
+
[0.55.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.54.0...ruby-v0.55.0
|
|
529
550
|
[0.54.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.53.0...ruby-v0.54.0
|
|
530
551
|
[0.53.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.52.1...ruby-v0.53.0
|
|
531
552
|
[0.52.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.52.0...ruby-v0.52.1
|
data/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "jsonschema-rb"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.55.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["Dmitry Dygalo <dmitry@dygalo.dev>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -14,7 +14,7 @@ crate-type = ["cdylib"]
|
|
|
14
14
|
|
|
15
15
|
[dependencies]
|
|
16
16
|
strum = "0.28.0"
|
|
17
|
-
jsonschema = { version = "0.
|
|
17
|
+
jsonschema = { version = "0.55.0", default-features = false, features = ["magnus", "arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros", "idna"] }
|
|
18
18
|
magnus = { version = "0.8", features = ["rb-sys"] }
|
|
19
19
|
rb-sys = "0.9"
|
|
20
20
|
serde = { workspace = true }
|
data/ext/jsonschema/Cargo.lock
CHANGED
|
@@ -693,9 +693,9 @@ dependencies = [
|
|
|
693
693
|
|
|
694
694
|
[[package]]
|
|
695
695
|
name = "jsonschema"
|
|
696
|
-
version = "0.
|
|
696
|
+
version = "0.55.0"
|
|
697
697
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
698
|
-
checksum = "
|
|
698
|
+
checksum = "49e89c7d35509ab5248f4160addc47098d0f2b09221851bf6234a948f28a70c4"
|
|
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.
|
|
729
|
+
version = "0.55.0"
|
|
730
730
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
731
|
-
checksum = "
|
|
731
|
+
checksum = "505c4c6bcb4f5c735196ad34f3c50ca6b06e4785217623b55a05d374e31b1df2"
|
|
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.
|
|
739
|
+
version = "0.55.0"
|
|
740
740
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
741
|
-
checksum = "
|
|
741
|
+
checksum = "37be493d8ed344f351106f93946f031d6121997ada849fa46df45029618e22f8"
|
|
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.
|
|
758
|
+
version = "0.55.0"
|
|
759
759
|
dependencies = [
|
|
760
760
|
"jsonschema",
|
|
761
761
|
"magnus",
|
|
@@ -769,18 +769,18 @@ dependencies = [
|
|
|
769
769
|
|
|
770
770
|
[[package]]
|
|
771
771
|
name = "jsonschema-regex"
|
|
772
|
-
version = "0.
|
|
772
|
+
version = "0.55.0"
|
|
773
773
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
774
|
-
checksum = "
|
|
774
|
+
checksum = "a1fb77178bdde7326e2e414526342ad4e26b602ba5372e53440129dc061bc50b"
|
|
775
775
|
dependencies = [
|
|
776
776
|
"regex-syntax",
|
|
777
777
|
]
|
|
778
778
|
|
|
779
779
|
[[package]]
|
|
780
780
|
name = "jsonschema-value"
|
|
781
|
-
version = "0.
|
|
781
|
+
version = "0.55.0"
|
|
782
782
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
783
|
-
checksum = "
|
|
783
|
+
checksum = "7dadb285b774085f3f3e67cb48ecce59e5d92028f19a01fe014083a4fbaf7fea"
|
|
784
784
|
dependencies = [
|
|
785
785
|
"ahash",
|
|
786
786
|
"bytecount",
|
|
@@ -1135,9 +1135,9 @@ dependencies = [
|
|
|
1135
1135
|
|
|
1136
1136
|
[[package]]
|
|
1137
1137
|
name = "referencing"
|
|
1138
|
-
version = "0.
|
|
1138
|
+
version = "0.55.0"
|
|
1139
1139
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1140
|
-
checksum = "
|
|
1140
|
+
checksum = "1cc7249156d90d60480d54850c861c37c92f20c6dbb9ae85d98ecca19d81c0b2"
|
|
1141
1141
|
dependencies = [
|
|
1142
1142
|
"ahash",
|
|
1143
1143
|
"fluent-uri",
|
data/ext/jsonschema/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "jsonschema-rb-ext"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.55.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.
|
|
13
|
+
jsonschema = { version = "0.55.0", default-features = false, features = ["magnus", "arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros", "idna"] }
|
|
14
14
|
magnus = { version = "0.8", features = ["rb-sys"] }
|
|
15
15
|
rb-sys = "0.9"
|
|
16
|
-
referencing = "0.
|
|
16
|
+
referencing = "0.55.0"
|
|
17
17
|
serde = { version = "1", features = ["derive"] }
|
|
18
18
|
serde_json = { version = "1", features = ["arbitrary_precision"] }
|
|
19
19
|
strum = "0.28.0"
|
data/lib/jsonschema/version.rb
CHANGED
data/sig/jsonschema.rbs
CHANGED
|
@@ -207,7 +207,7 @@ module JSONSchema
|
|
|
207
207
|
def properties: () -> Hash[String, CanonicalSchema]
|
|
208
208
|
def pattern_properties: () -> Hash[String, CanonicalSchema]
|
|
209
209
|
def additional_properties: () -> CanonicalSchema?
|
|
210
|
-
def violations: () -> Array[NameFailsView | UndeclaredValueFailsView]
|
|
210
|
+
def violations: () -> Array[NameFailsView | UndeclaredValueFailsView | PatternValueFailsView]
|
|
211
211
|
def inspect: () -> String
|
|
212
212
|
def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
|
|
213
213
|
end
|
|
@@ -228,6 +228,14 @@ module JSONSchema
|
|
|
228
228
|
def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
|
|
229
229
|
end
|
|
230
230
|
|
|
231
|
+
# Some key matching `pattern` has a value failing `schema`.
|
|
232
|
+
class PatternValueFailsView
|
|
233
|
+
def pattern: () -> String
|
|
234
|
+
def schema: () -> CanonicalSchema
|
|
235
|
+
def inspect: () -> String
|
|
236
|
+
def deconstruct_keys: (untyped keys) -> Hash[Symbol, untyped]
|
|
237
|
+
end
|
|
238
|
+
|
|
231
239
|
# The complement of an opaque schema.
|
|
232
240
|
class NotView
|
|
233
241
|
def schema: () -> CanonicalSchema
|
data/src/canonical.rs
CHANGED
|
@@ -846,6 +846,12 @@ fn object_violation_to_ruby(ruby: &Ruby, violation: &CoreObjectViolationView) ->
|
|
|
846
846
|
additional: additional.clone(),
|
|
847
847
|
})
|
|
848
848
|
.as_value(),
|
|
849
|
+
CoreObjectViolationView::PatternValueFails { pattern, schema } => ruby
|
|
850
|
+
.obj_wrap(PatternValueFailsView {
|
|
851
|
+
pattern: pattern.clone(),
|
|
852
|
+
schema: schema.clone(),
|
|
853
|
+
})
|
|
854
|
+
.as_value(),
|
|
849
855
|
}
|
|
850
856
|
}
|
|
851
857
|
|
|
@@ -936,6 +942,47 @@ impl UndeclaredValueFailsView {
|
|
|
936
942
|
}
|
|
937
943
|
}
|
|
938
944
|
|
|
945
|
+
/// Some key matching `pattern` has a value failing `schema`.
|
|
946
|
+
#[derive(magnus::TypedData)]
|
|
947
|
+
#[magnus(
|
|
948
|
+
class = "JSONSchema::Canonical::PatternValueFailsView",
|
|
949
|
+
free_immediately
|
|
950
|
+
)]
|
|
951
|
+
pub struct PatternValueFailsView {
|
|
952
|
+
pattern: String,
|
|
953
|
+
schema: CanonicalSchema,
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
impl DataTypeFunctions for PatternValueFailsView {}
|
|
957
|
+
|
|
958
|
+
impl PatternValueFailsView {
|
|
959
|
+
fn pattern(ruby: &Ruby, rb_self: &Self) -> Value {
|
|
960
|
+
ruby.str_new(&rb_self.pattern).as_value()
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
fn schema(ruby: &Ruby, rb_self: &Self) -> Value {
|
|
964
|
+
ruby.obj_wrap(RbCanonicalSchema {
|
|
965
|
+
inner: rb_self.schema.clone(),
|
|
966
|
+
})
|
|
967
|
+
.as_value()
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
fn inspect(ruby: &Ruby, rb_self: &Self) -> String {
|
|
971
|
+
format!(
|
|
972
|
+
"#<JSONSchema::Canonical::PatternValueFailsView pattern={} schema={}>",
|
|
973
|
+
Self::pattern(ruby, rb_self).inspect(),
|
|
974
|
+
Self::schema(ruby, rb_self).inspect()
|
|
975
|
+
)
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
fn deconstruct_keys(ruby: &Ruby, rb_self: &Self, _keys: Value) -> Result<RHash, Error> {
|
|
979
|
+
let hash = ruby.hash_new();
|
|
980
|
+
hash.aset(ruby.sym_new("pattern"), Self::pattern(ruby, rb_self))?;
|
|
981
|
+
hash.aset(ruby.sym_new("schema"), Self::schema(ruby, rb_self))?;
|
|
982
|
+
Ok(hash)
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
939
986
|
/// An object value's constraints.
|
|
940
987
|
#[derive(magnus::TypedData)]
|
|
941
988
|
#[magnus(class = "JSONSchema::Canonical::ObjectView", free_immediately)]
|
|
@@ -1580,6 +1627,18 @@ pub(crate) fn init_canonical(ruby: &Ruby, module: &RModule) -> Result<(), Error>
|
|
|
1580
1627
|
method!(UndeclaredValueFailsView::deconstruct_keys, 1),
|
|
1581
1628
|
)?;
|
|
1582
1629
|
|
|
1630
|
+
let pattern_value_fails_view =
|
|
1631
|
+
canonical_module.define_class("PatternValueFailsView", ruby.class_object())?;
|
|
1632
|
+
pattern_value_fails_view
|
|
1633
|
+
.define_method("pattern", method!(PatternValueFailsView::pattern, 0))?;
|
|
1634
|
+
pattern_value_fails_view.define_method("schema", method!(PatternValueFailsView::schema, 0))?;
|
|
1635
|
+
pattern_value_fails_view
|
|
1636
|
+
.define_method("inspect", method!(PatternValueFailsView::inspect, 0))?;
|
|
1637
|
+
pattern_value_fails_view.define_method(
|
|
1638
|
+
"deconstruct_keys",
|
|
1639
|
+
method!(PatternValueFailsView::deconstruct_keys, 1),
|
|
1640
|
+
)?;
|
|
1641
|
+
|
|
1583
1642
|
let object_view = canonical_module.define_class("ObjectView", ruby.class_object())?;
|
|
1584
1643
|
object_view.define_method("min_properties", method!(ObjectView::min_properties, 0))?;
|
|
1585
1644
|
object_view.define_method("max_properties", method!(ObjectView::max_properties, 0))?;
|