jsonschema_rs 0.63.2 → 0.64.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 +15 -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 +1 -0
- data/src/evaluation.rs +51 -15
- data/src/json_text.rs +1 -1
- data/src/lib.rs +6 -6
- data/src/options.rs +0 -63
- 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: 3c415f55364770e9848a99ecf80fa0b8415b6c6d705f0d002996152cf707f8ae
|
|
4
|
+
data.tar.gz: f52ffb656e2ba36a761242a2649e497a8b38f78aff087d29aaff89e010c5aa10
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9fee91bcac65b122b22f4191d1b95ac87759042c2017c55cc4af49cb3d71f0f7937332dc055afecdd19c5fb42f49b6628918a4499d61a6f3752bb134ae93fde
|
|
7
|
+
data.tar.gz: 9c312f8837ef5829b3c05b4f61ef30560ad663484203b85715f364eecd420c57c0f85afe388b3504f5bafef787aaccc685d38f76fd700d2c385c5d3316027e6a
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.64.0] - 2026-12-01
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `mask:` hiding instance values in `Evaluation` outputs, and on `JSONSchema.evaluate`.
|
|
10
|
+
- Canonicalization of a `pattern` that cannot fit `minLength` or `maxLength`, which reduces to `false`.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- External `$ref`s in `then` or `else` without `if` causing validator construction to fail. [#2056](https://github.com/Stranger6667/jsonschema/issues/2056)
|
|
15
|
+
- `contentEncoding: base16` accepting strings with characters whose uppercase form is a hex digit, such as U+FB00 (LATIN SMALL LIGATURE FF).
|
|
16
|
+
- `CanonicalSchema#satisfiability` answering `:unknown` for Draft 4 schemas that need an integer.
|
|
17
|
+
|
|
5
18
|
## [0.63.2] - 2026-11-26
|
|
6
19
|
|
|
7
20
|
### Fixed
|
|
@@ -885,7 +898,8 @@
|
|
|
885
898
|
|
|
886
899
|
- Initial public release
|
|
887
900
|
|
|
888
|
-
[Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.
|
|
901
|
+
[Unreleased]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.64.0...HEAD
|
|
902
|
+
[0.64.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.63.2...ruby-v0.64.0
|
|
889
903
|
[0.63.2]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.63.1...ruby-v0.63.2
|
|
890
904
|
[0.63.1]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.63.0...ruby-v0.63.1
|
|
891
905
|
[0.63.0]: https://github.com/Stranger6667/jsonschema/compare/ruby-v0.62.0...ruby-v0.63.0
|
data/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "jsonschema-rb"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.64.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.64.0", default-features = false, features = ["magnus", "arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros", "idna", "json-text"] }
|
|
18
18
|
magnus = { version = "0.9", features = ["rb-sys"] }
|
|
19
19
|
rb-sys = "0.9"
|
|
20
20
|
serde = { workspace = true }
|
data/ext/jsonschema/Cargo.lock
CHANGED
|
@@ -683,9 +683,9 @@ dependencies = [
|
|
|
683
683
|
|
|
684
684
|
[[package]]
|
|
685
685
|
name = "jsonschema"
|
|
686
|
-
version = "0.
|
|
686
|
+
version = "0.64.0"
|
|
687
687
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
688
|
-
checksum = "
|
|
688
|
+
checksum = "0fc405718cd607fb9cbcc5aad5d08f02633b3b8151a299e26d18dfc4102dd39a"
|
|
689
689
|
dependencies = [
|
|
690
690
|
"ahash",
|
|
691
691
|
"bytecount",
|
|
@@ -717,9 +717,9 @@ dependencies = [
|
|
|
717
717
|
|
|
718
718
|
[[package]]
|
|
719
719
|
name = "jsonschema-macros"
|
|
720
|
-
version = "0.
|
|
720
|
+
version = "0.64.0"
|
|
721
721
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
722
|
-
checksum = "
|
|
722
|
+
checksum = "e480ffde799040733514de22cdf4cfb4e9189131950d431a86cce052687321b3"
|
|
723
723
|
dependencies = [
|
|
724
724
|
"jsonschema-macros-core",
|
|
725
725
|
"proc-macro2",
|
|
@@ -727,9 +727,9 @@ dependencies = [
|
|
|
727
727
|
|
|
728
728
|
[[package]]
|
|
729
729
|
name = "jsonschema-macros-core"
|
|
730
|
-
version = "0.
|
|
730
|
+
version = "0.64.0"
|
|
731
731
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
732
|
-
checksum = "
|
|
732
|
+
checksum = "cea5c8b9d4063f399cb7dfbe57d3d46506787b6ae6c1305b9250123322ebfbc4"
|
|
733
733
|
dependencies = [
|
|
734
734
|
"fancy-regex",
|
|
735
735
|
"indexmap",
|
|
@@ -746,7 +746,7 @@ dependencies = [
|
|
|
746
746
|
|
|
747
747
|
[[package]]
|
|
748
748
|
name = "jsonschema-rb-ext"
|
|
749
|
-
version = "0.
|
|
749
|
+
version = "0.64.0"
|
|
750
750
|
dependencies = [
|
|
751
751
|
"jsonschema",
|
|
752
752
|
"magnus",
|
|
@@ -760,18 +760,18 @@ dependencies = [
|
|
|
760
760
|
|
|
761
761
|
[[package]]
|
|
762
762
|
name = "jsonschema-regex"
|
|
763
|
-
version = "0.
|
|
763
|
+
version = "0.64.0"
|
|
764
764
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
765
|
-
checksum = "
|
|
765
|
+
checksum = "124760dd86ebf5d6d51b55c7011ac870a7071037414b2000320d4c1b0a802a0e"
|
|
766
766
|
dependencies = [
|
|
767
767
|
"regex-syntax",
|
|
768
768
|
]
|
|
769
769
|
|
|
770
770
|
[[package]]
|
|
771
771
|
name = "jsonschema-value"
|
|
772
|
-
version = "0.
|
|
772
|
+
version = "0.64.0"
|
|
773
773
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
774
|
-
checksum = "
|
|
774
|
+
checksum = "5a77769282904d719e783063e972271ee6a6165405d1426ba1883f3c3aa440eb"
|
|
775
775
|
dependencies = [
|
|
776
776
|
"ahash",
|
|
777
777
|
"bytecount",
|
|
@@ -1126,9 +1126,9 @@ dependencies = [
|
|
|
1126
1126
|
|
|
1127
1127
|
[[package]]
|
|
1128
1128
|
name = "referencing"
|
|
1129
|
-
version = "0.
|
|
1129
|
+
version = "0.64.0"
|
|
1130
1130
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1131
|
-
checksum = "
|
|
1131
|
+
checksum = "4df1fff99ff80158eea407a1009049b4e5decd3d6cef798104251148d65c45fb"
|
|
1132
1132
|
dependencies = [
|
|
1133
1133
|
"ahash",
|
|
1134
1134
|
"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.64.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.64.0", default-features = false, features = ["magnus", "arbitrary-precision", "resolve-http", "resolve-file", "tls-ring", "macros", "idna", "json-text"] }
|
|
14
14
|
magnus = { version = "0.9", features = ["rb-sys"] }
|
|
15
15
|
rb-sys = "0.9"
|
|
16
|
-
referencing = "0.
|
|
16
|
+
referencing = "0.64.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
|
@@ -537,6 +537,7 @@ module JSONSchema
|
|
|
537
537
|
?validate_formats: bool?,
|
|
538
538
|
?ignore_unknown_formats: bool?,
|
|
539
539
|
?vocabularies: Array[String]?,
|
|
540
|
+
?mask: String?,
|
|
540
541
|
?base_uri: String?,
|
|
541
542
|
?retriever: (^(String) -> untyped)?,
|
|
542
543
|
?formats: Hash[String, (^(String) -> bool) | NumberFormat]?,
|
data/src/evaluation.rs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
//! Evaluation output wrapper for Ruby
|
|
2
2
|
//!
|
|
3
3
|
//! Provides full JSON Schema output format support: flag, list, and hierarchical.
|
|
4
|
+
use std::borrow::Cow;
|
|
5
|
+
|
|
4
6
|
use jsonschema::{output::ErrorDescription, OutputUnit};
|
|
5
7
|
use magnus::{method, prelude::*, Error, RArray, RHash, RModule, Ruby, Value};
|
|
6
8
|
|
|
@@ -20,11 +22,15 @@ define_rb_intern!(static ID_DETAILS: "details");
|
|
|
20
22
|
#[magnus::wrap(class = "JSONSchema::Evaluation", free_immediately, size)]
|
|
21
23
|
pub struct Evaluation {
|
|
22
24
|
inner: jsonschema::Evaluation,
|
|
25
|
+
mask: Option<String>,
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
impl Evaluation {
|
|
26
|
-
pub fn new(output: jsonschema::Evaluation) -> Self {
|
|
27
|
-
Evaluation {
|
|
29
|
+
pub fn new(output: jsonschema::Evaluation, mask: Option<String>) -> Self {
|
|
30
|
+
Evaluation {
|
|
31
|
+
inner: output,
|
|
32
|
+
mask,
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
fn is_valid(&self) -> bool {
|
|
@@ -43,7 +49,7 @@ impl Evaluation {
|
|
|
43
49
|
fn list(ruby: &Ruby, rb_self: &Self) -> Result<Value, Error> {
|
|
44
50
|
let root = rb_self.inner.root();
|
|
45
51
|
let details = ruby.ary_new();
|
|
46
|
-
list_units(ruby, root, details)?;
|
|
52
|
+
list_units(ruby, root, details, rb_self.mask.as_deref())?;
|
|
47
53
|
let hash = ruby.hash_new_capa(2);
|
|
48
54
|
hash.aset(ID_VALID.to_symbol(), root.valid())?;
|
|
49
55
|
hash.aset(ID_DETAILS.to_symbol(), details)?;
|
|
@@ -52,7 +58,7 @@ impl Evaluation {
|
|
|
52
58
|
|
|
53
59
|
/// Nested tree structure following the schema structure.
|
|
54
60
|
fn hierarchical(ruby: &Ruby, rb_self: &Self) -> Result<Value, Error> {
|
|
55
|
-
Ok(unit_to_ruby(ruby, rb_self.inner.root(), true)?.as_value())
|
|
61
|
+
Ok(unit_to_ruby(ruby, rb_self.inner.root(), true, rb_self.mask.as_deref())?.as_value())
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
fn annotations(ruby: &Ruby, rb_self: &Self) -> Result<Value, Error> {
|
|
@@ -94,7 +100,10 @@ impl Evaluation {
|
|
|
94
100
|
hash.aset(abs_kw_loc, ruby.qnil())?;
|
|
95
101
|
}
|
|
96
102
|
hash.aset(inst_loc, entry.instance_location.as_str())?;
|
|
97
|
-
hash.aset(
|
|
103
|
+
hash.aset(
|
|
104
|
+
error_key,
|
|
105
|
+
message(entry.error, rb_self.mask.as_deref()).as_ref(),
|
|
106
|
+
)?;
|
|
98
107
|
arr.push(hash)?;
|
|
99
108
|
}
|
|
100
109
|
Ok(arr.as_value())
|
|
@@ -107,7 +116,12 @@ impl Evaluation {
|
|
|
107
116
|
|
|
108
117
|
// Builds an output unit straight into a Ruby Hash, with the keys and order the serialized
|
|
109
118
|
// output has.
|
|
110
|
-
fn unit_to_ruby(
|
|
119
|
+
fn unit_to_ruby(
|
|
120
|
+
ruby: &Ruby,
|
|
121
|
+
unit: OutputUnit<'_>,
|
|
122
|
+
nested: bool,
|
|
123
|
+
mask: Option<&str>,
|
|
124
|
+
) -> Result<RHash, Error> {
|
|
111
125
|
// Inserted with one `bulk_insert` call.
|
|
112
126
|
let mut pairs = [ruby.qnil().as_value(); 16];
|
|
113
127
|
let mut len = 0;
|
|
@@ -147,7 +161,7 @@ fn unit_to_ruby(ruby: &Ruby, unit: OutputUnit<'_>, nested: bool) -> Result<RHash
|
|
|
147
161
|
if !unit.errors().is_empty() {
|
|
148
162
|
push(
|
|
149
163
|
ID_ERRORS.to_symbol().as_value(),
|
|
150
|
-
errors_to_ruby(ruby, unit.errors())?.as_value(),
|
|
164
|
+
errors_to_ruby(ruby, unit.errors(), mask)?.as_value(),
|
|
151
165
|
);
|
|
152
166
|
}
|
|
153
167
|
if nested {
|
|
@@ -155,7 +169,7 @@ fn unit_to_ruby(ruby: &Ruby, unit: OutputUnit<'_>, nested: bool) -> Result<RHash
|
|
|
155
169
|
if children.peek().is_some() {
|
|
156
170
|
let details = ruby.ary_new();
|
|
157
171
|
for child in children {
|
|
158
|
-
details.push(unit_to_ruby(ruby, child, true)?)?;
|
|
172
|
+
details.push(unit_to_ruby(ruby, child, true, mask)?)?;
|
|
159
173
|
}
|
|
160
174
|
push(ID_DETAILS.to_symbol().as_value(), details.as_value());
|
|
161
175
|
}
|
|
@@ -165,16 +179,33 @@ fn unit_to_ruby(ruby: &Ruby, unit: OutputUnit<'_>, nested: bool) -> Result<RHash
|
|
|
165
179
|
Ok(hash)
|
|
166
180
|
}
|
|
167
181
|
|
|
168
|
-
fn list_units(
|
|
169
|
-
|
|
182
|
+
fn list_units(
|
|
183
|
+
ruby: &Ruby,
|
|
184
|
+
unit: OutputUnit<'_>,
|
|
185
|
+
out: RArray,
|
|
186
|
+
mask: Option<&str>,
|
|
187
|
+
) -> Result<(), Error> {
|
|
188
|
+
out.push(unit_to_ruby(ruby, unit, false, mask)?)?;
|
|
170
189
|
for child in unit.children() {
|
|
171
|
-
list_units(ruby, child, out)?;
|
|
190
|
+
list_units(ruby, child, out, mask)?;
|
|
172
191
|
}
|
|
173
192
|
Ok(())
|
|
174
193
|
}
|
|
175
194
|
|
|
195
|
+
/// The message of `error`, with `mask` in place of instance values when set.
|
|
196
|
+
fn message<'e>(error: &'e ErrorDescription, mask: Option<&str>) -> Cow<'e, str> {
|
|
197
|
+
match mask {
|
|
198
|
+
Some(mask) => Cow::Owned(error.masked_with(mask).to_string()),
|
|
199
|
+
None => Cow::Borrowed(error.message()),
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
176
203
|
/// Messages grouped by keyword in first-seen order: one message as a String, several as an Array.
|
|
177
|
-
fn errors_to_ruby(
|
|
204
|
+
fn errors_to_ruby(
|
|
205
|
+
ruby: &Ruby,
|
|
206
|
+
errors: &[ErrorDescription],
|
|
207
|
+
mask: Option<&str>,
|
|
208
|
+
) -> Result<RHash, Error> {
|
|
178
209
|
let hash = ruby.hash_new();
|
|
179
210
|
for (index, error) in errors.iter().enumerate() {
|
|
180
211
|
let keyword = error.keyword();
|
|
@@ -184,12 +215,17 @@ fn errors_to_ruby(ruby: &Ruby, errors: &[ErrorDescription]) -> Result<RHash, Err
|
|
|
184
215
|
let mut messages = errors[index..]
|
|
185
216
|
.iter()
|
|
186
217
|
.filter(|other| other.keyword() == keyword)
|
|
187
|
-
.map(
|
|
218
|
+
.map(|error| message(error, mask));
|
|
188
219
|
let first = messages.next().expect("the current error has this keyword");
|
|
189
220
|
match messages.next() {
|
|
190
|
-
None => hash.aset(keyword, first)?,
|
|
221
|
+
None => hash.aset(keyword, first.as_ref())?,
|
|
191
222
|
Some(second) => {
|
|
192
|
-
let all = ruby.ary_from_iter(
|
|
223
|
+
let all = ruby.ary_from_iter(
|
|
224
|
+
[first, second]
|
|
225
|
+
.into_iter()
|
|
226
|
+
.chain(messages)
|
|
227
|
+
.map(|message| ruby.str_new(&message)),
|
|
228
|
+
);
|
|
193
229
|
hash.aset(keyword, all)?;
|
|
194
230
|
}
|
|
195
231
|
}
|
data/src/json_text.rs
CHANGED
|
@@ -212,7 +212,7 @@ impl JsonTextValidator {
|
|
|
212
212
|
catch_unwind_silent(AssertUnwindSafe(|| {
|
|
213
213
|
rb_self.validator.evaluate(document.root())
|
|
214
214
|
}))
|
|
215
|
-
.map(Evaluation::new)
|
|
215
|
+
.map(|output| Evaluation::new(output, rb_self.mask.clone()))
|
|
216
216
|
.map_err(|err| handle_callback_panic(ruby, err))
|
|
217
217
|
}
|
|
218
218
|
|
data/src/lib.rs
CHANGED
|
@@ -50,9 +50,8 @@ use crate::{
|
|
|
50
50
|
evaluation::Evaluation,
|
|
51
51
|
json_text::text_node_to_ruby,
|
|
52
52
|
options::{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
ParsedOptions,
|
|
53
|
+
extract_kwargs, extract_kwargs_no_draft, make_options_from_kwargs, parse_draft_symbol,
|
|
54
|
+
CallbackRoots, CompilationRoots, CompilationRootsRef, ExtractedKwargs, ParsedOptions,
|
|
56
55
|
},
|
|
57
56
|
registry::Registry,
|
|
58
57
|
retriever::{retriever_error_message, RubyRetriever},
|
|
@@ -799,7 +798,7 @@ impl Validator {
|
|
|
799
798
|
let _scope = KeywordCauseScope::enter();
|
|
800
799
|
let result = catch_unwind_silent(AssertUnwindSafe(|| rb_self.validator.evaluate(node)));
|
|
801
800
|
match result {
|
|
802
|
-
Ok(output) => Ok(Evaluation::new(output)),
|
|
801
|
+
Ok(output) => Ok(Evaluation::new(output, rb_self.mask.clone())),
|
|
803
802
|
Err(err) => Err(handle_callback_panic(ruby, err)),
|
|
804
803
|
}
|
|
805
804
|
})
|
|
@@ -1121,10 +1120,11 @@ fn evaluate(ruby: &Ruby, args: &[Value]) -> Result<Evaluation, Error> {
|
|
|
1121
1120
|
let _scope = KeywordCauseScope::enter();
|
|
1122
1121
|
let parsed_args = scan_args::<(Value, Value), (), (), (), _, ()>(args)?;
|
|
1123
1122
|
let (schema, instance) = parsed_args.required;
|
|
1124
|
-
let kw =
|
|
1123
|
+
let kw = extract_kwargs(ruby, parsed_args.keywords)?;
|
|
1125
1124
|
|
|
1126
1125
|
let json_schema = to_schema_value(ruby, schema)?;
|
|
1127
1126
|
let parsed = build_parsed_options::<Magnus>(ruby, kw, None)?;
|
|
1127
|
+
let mask = parsed.mask;
|
|
1128
1128
|
let BuiltValidator {
|
|
1129
1129
|
validator,
|
|
1130
1130
|
compilation_roots: _compilation_roots,
|
|
@@ -1141,7 +1141,7 @@ fn evaluate(ruby: &Ruby, args: &[Value]) -> Result<Evaluation, Error> {
|
|
|
1141
1141
|
|
|
1142
1142
|
surface_pending_errors(instance, |node| {
|
|
1143
1143
|
match catch_unwind_silent(AssertUnwindSafe(|| validator.evaluate(node))) {
|
|
1144
|
-
Ok(output) => Ok(Evaluation::new(output)),
|
|
1144
|
+
Ok(output) => Ok(Evaluation::new(output, mask)),
|
|
1145
1145
|
Err(err) => Err(handle_callback_panic(ruby, err)),
|
|
1146
1146
|
}
|
|
1147
1147
|
})
|
data/src/options.rs
CHANGED
|
@@ -135,19 +135,6 @@ fn base_option_ids() -> [StaticId; 9] {
|
|
|
135
135
|
*KW_REGISTRY,
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
|
-
fn base_option_ids_no_mask() -> [StaticId; 8] {
|
|
139
|
-
[
|
|
140
|
-
*KW_DRAFT,
|
|
141
|
-
*KW_VALIDATE_FORMATS,
|
|
142
|
-
*KW_IGNORE_UNKNOWN_FORMATS,
|
|
143
|
-
*KW_BASE_URI,
|
|
144
|
-
*KW_RETRIEVER,
|
|
145
|
-
*KW_FORMATS,
|
|
146
|
-
*KW_KEYWORDS,
|
|
147
|
-
*KW_REGISTRY,
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
|
|
151
138
|
type BaseKwargs = (
|
|
152
139
|
Option<Value>,
|
|
153
140
|
Option<bool>,
|
|
@@ -159,16 +146,6 @@ type BaseKwargs = (
|
|
|
159
146
|
Option<RHash>,
|
|
160
147
|
Option<Value>,
|
|
161
148
|
);
|
|
162
|
-
type BaseKwargsNoMask = (
|
|
163
|
-
Option<Value>,
|
|
164
|
-
Option<bool>,
|
|
165
|
-
Option<bool>,
|
|
166
|
-
Option<String>,
|
|
167
|
-
Option<Value>,
|
|
168
|
-
Option<RHash>,
|
|
169
|
-
Option<RHash>,
|
|
170
|
-
Option<Value>,
|
|
171
|
-
);
|
|
172
149
|
type BaseKwargsNoDraft = (
|
|
173
150
|
Option<bool>,
|
|
174
151
|
Option<bool>,
|
|
@@ -250,46 +227,6 @@ pub fn extract_kwargs(_ruby: &Ruby, kw: RHash) -> Result<ExtractedKwargs, Error>
|
|
|
250
227
|
})
|
|
251
228
|
}
|
|
252
229
|
|
|
253
|
-
pub fn extract_evaluate_kwargs(_ruby: &Ruby, kw: RHash) -> Result<ExtractedKwargs, Error> {
|
|
254
|
-
let vocabularies = extract_vocabularies(&kw)?;
|
|
255
|
-
let pattern_options = extract_and_delete(&kw, *KW_PATTERN_OPTIONS)?;
|
|
256
|
-
let email_options = extract_and_delete(&kw, *KW_EMAIL_OPTIONS)?;
|
|
257
|
-
let http_options = extract_and_delete(&kw, *KW_HTTP_OPTIONS)?;
|
|
258
|
-
let offline = extract_offline(&kw)?;
|
|
259
|
-
|
|
260
|
-
let ids = base_option_ids_no_mask();
|
|
261
|
-
let base_kw: KwArgs<(), BaseKwargsNoMask, ()> = get_kwargs(kw, &[], &ids)?;
|
|
262
|
-
let (
|
|
263
|
-
draft,
|
|
264
|
-
validate_formats,
|
|
265
|
-
ignore_unknown_formats,
|
|
266
|
-
base_uri,
|
|
267
|
-
retriever,
|
|
268
|
-
formats,
|
|
269
|
-
keywords,
|
|
270
|
-
registry,
|
|
271
|
-
) = base_kw.optional;
|
|
272
|
-
|
|
273
|
-
Ok(ExtractedKwargs {
|
|
274
|
-
base: (
|
|
275
|
-
draft,
|
|
276
|
-
validate_formats,
|
|
277
|
-
ignore_unknown_formats,
|
|
278
|
-
None,
|
|
279
|
-
base_uri,
|
|
280
|
-
retriever,
|
|
281
|
-
formats,
|
|
282
|
-
keywords,
|
|
283
|
-
registry,
|
|
284
|
-
),
|
|
285
|
-
vocabularies,
|
|
286
|
-
pattern_options,
|
|
287
|
-
email_options,
|
|
288
|
-
http_options,
|
|
289
|
-
offline,
|
|
290
|
-
})
|
|
291
|
-
}
|
|
292
|
-
|
|
293
230
|
pub fn extract_kwargs_no_draft(_ruby: &Ruby, kw: RHash) -> Result<ExtractedKwargs, Error> {
|
|
294
231
|
let vocabularies = extract_vocabularies(&kw)?;
|
|
295
232
|
let pattern_options = extract_and_delete(&kw, *KW_PATTERN_OPTIONS)?;
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jsonschema_rs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.64.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Dygalo
|
|
@@ -81,7 +81,7 @@ metadata:
|
|
|
81
81
|
homepage_uri: https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-rb
|
|
82
82
|
source_code_uri: https://github.com/Stranger6667/jsonschema
|
|
83
83
|
changelog_uri: https://github.com/Stranger6667/jsonschema/blob/master/crates/jsonschema-rb/CHANGELOG.md
|
|
84
|
-
documentation_uri: https://github.com/Stranger6667/jsonschema/blob/ruby-v0.
|
|
84
|
+
documentation_uri: https://github.com/Stranger6667/jsonschema/blob/ruby-v0.64.0/crates/jsonschema-rb/README.md
|
|
85
85
|
bug_tracker_uri: https://github.com/Stranger6667/jsonschema/issues
|
|
86
86
|
funding_uri: https://github.com/sponsors/Stranger6667
|
|
87
87
|
rubygems_mfa_required: 'true'
|