rusty_json_schema 0.9.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bf92f5d1ed9c0186380f1ada17deae759ecfaf396f9f997094b6672df710d33
4
- data.tar.gz: 0a7dc445d6b9765794ac4a19c030c862a503e90e679191b6abddfba595fbb092
3
+ metadata.gz: 29f2fb5ead80040422387ea9ee95e400f8a48a3e376dcfc1755330d4db14a52a
4
+ data.tar.gz: 7588135d9a3f0cc439195f272f6f142937060282a43668681e5e8570d05317a1
5
5
  SHA512:
6
- metadata.gz: f620866be4dc3ec9ba8c0cf544a888034e6352587f212c5bbb7e9589a7bd93055f0073337d9f465e0ba79abe1686745f1abe48cd0a39b4830683014406ddf898
7
- data.tar.gz: bf084b4eefbc2f3988894ccf1ef8224c500ebce40373d2737b3fe86715fc4964599634edb7c3d12bd8997ae3b4a31c3a56dba0d2c1c1ef6e1def7227bfda01d7
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.6.1"
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.81"
13
- jsonschema = "0.9.0"
12
+ libc = "0.2.121"
13
+ jsonschema = "0.15.0"
14
14
  serde_json = "1.0"
Binary file
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RustyJSONSchema
4
4
 
5
- VERSION = "0.9.0"
5
+ VERSION = "0.15.0"
6
6
 
7
7
  end
@@ -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"] = "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"
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 and schema value,
11
- * we need to hold onto value in order to not have
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<'static>,
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
- * and schema value, we free them up separately
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 boxed_schema: &'static Value = Box::leak(Box::new(schema));
27
- let boxed_compile: &'static JSONSchema<'static> =
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.9.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: 2021-06-02 00:00:00.000000000 Z
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: