rusty_json_schema 0.9.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.toml +3 -3
- data/ext/json_schema.so.x64-mingw32.default +0 -0
- data/ext/json_schema.so.x86_64-darwin.default +0 -0
- data/ext/json_schema.so.x86_64-linux.default +0 -0
- data/lib/rusty_json_schema/version.rb +1 -1
- data/rusty_json_schema.gemspec +5 -4
- data/src/lib.rs +7 -13
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29f2fb5ead80040422387ea9ee95e400f8a48a3e376dcfc1755330d4db14a52a
|
4
|
+
data.tar.gz: 7588135d9a3f0cc439195f272f6f142937060282a43668681e5e8570d05317a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca5e12925de57af28fb53216313181409a9523e91414f711615d9ab4ea819c19e5be1ef76e0c6868942082e16263ac0ed5ff25867cb5f0a2a94ae3b87711dc1
|
7
|
+
data.tar.gz: e140c075a9d5e0d58dc7d391abf250c53704e9f5cb1bc14e742f5f31e57e1335a085b117b589ab1b6fab8520cfcd565078da1a7b86e92977f115f5a9f31f3458
|
data/Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[package]
|
2
2
|
name = "json_schema"
|
3
|
-
version = "0.
|
3
|
+
version = "0.15.0"
|
4
4
|
authors = ["Leszek Zalewski <leszekzalewski@fastmail.fm>"]
|
5
5
|
edition = "2018"
|
6
6
|
|
@@ -9,6 +9,6 @@ name = "json_schema"
|
|
9
9
|
crate-type = ["cdylib"]
|
10
10
|
|
11
11
|
[dependencies]
|
12
|
-
libc = "0.2.
|
13
|
-
jsonschema = "0.
|
12
|
+
libc = "0.2.121"
|
13
|
+
jsonschema = "0.15.0"
|
14
14
|
serde_json = "1.0"
|
Binary file
|
Binary file
|
Binary file
|
data/rusty_json_schema.gemspec
CHANGED
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
18
18
|
|
19
19
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
20
20
|
|
21
|
-
spec.metadata["allowed_push_host"]
|
22
|
-
spec.metadata["homepage_uri"]
|
23
|
-
spec.metadata["source_code_uri"]
|
24
|
-
spec.metadata["changelog_uri"]
|
21
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
24
|
+
spec.metadata["changelog_uri"] = "https://github.com/driv3r/rusty_json_schema/blob/main/CHANGELOG.md"
|
25
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
25
26
|
|
26
27
|
spec.files = Dir[
|
27
28
|
"lib/**/*",
|
data/src/lib.rs
CHANGED
@@ -7,29 +7,24 @@ use std::ffi::{CStr, CString};
|
|
7
7
|
use std::os::raw::{c_char, c_uint};
|
8
8
|
|
9
9
|
/*
|
10
|
-
* Our wrapper struct for schema
|
11
|
-
*
|
12
|
-
* it freed up, as JSONSchema uses it as reference.
|
10
|
+
* Our wrapper struct for schema, we need to hold
|
11
|
+
* onto value in order to not have it freed up.
|
13
12
|
*/
|
14
13
|
pub struct Validator {
|
15
|
-
schema: &'static JSONSchema
|
16
|
-
schema_value: &'static Value,
|
14
|
+
schema: &'static JSONSchema,
|
17
15
|
}
|
18
16
|
|
19
17
|
impl Validator {
|
20
18
|
/*
|
21
|
-
* With Box::leak we avoid freeing up of schema
|
22
|
-
*
|
23
|
-
* in the Drop implementation
|
19
|
+
* With Box::leak we avoid freeing up of schema,
|
20
|
+
* we free them up separately in the Drop implementation
|
24
21
|
*/
|
25
22
|
fn new(schema: Value) -> Validator {
|
26
|
-
let
|
27
|
-
|
28
|
-
Box::leak(Box::new(JSONSchema::compile(boxed_schema).unwrap()));
|
23
|
+
let boxed_compile: &'static JSONSchema =
|
24
|
+
Box::leak(Box::new(JSONSchema::compile(&schema).unwrap()));
|
29
25
|
|
30
26
|
Validator {
|
31
27
|
schema: boxed_compile,
|
32
|
-
schema_value: boxed_schema,
|
33
28
|
}
|
34
29
|
}
|
35
30
|
|
@@ -63,7 +58,6 @@ impl Drop for Validator {
|
|
63
58
|
fn drop(&mut self) {
|
64
59
|
unsafe {
|
65
60
|
Box::from_raw(self.schema as *const _ as *mut JSONSchema);
|
66
|
-
Box::from_raw(self.schema_value as *const _ as *mut Value);
|
67
61
|
}
|
68
62
|
}
|
69
63
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rusty_json_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leszek Zalewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thermite
|
@@ -85,6 +85,7 @@ metadata:
|
|
85
85
|
homepage_uri: https://github.com/driv3r/rusty_json_schema
|
86
86
|
source_code_uri: https://github.com/driv3r/rusty_json_schema
|
87
87
|
changelog_uri: https://github.com/driv3r/rusty_json_schema/blob/main/CHANGELOG.md
|
88
|
+
rubygems_mfa_required: 'true'
|
88
89
|
post_install_message:
|
89
90
|
rdoc_options: []
|
90
91
|
require_paths:
|