corvus_json_schema 0.1.0 → 0.1.1

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: 366ca7a2a830bed49d2be6be081363501353c1239eeb05034acfaf6e4317b489
4
- data.tar.gz: 8858ea69b92c78f4be20f0a02e439f9322ef1248f0343d36adcc9cfd9f7547c9
3
+ metadata.gz: 31371364d14a0b654889fc47b325553d0c8c0851da6acdf8a32794704aca30d5
4
+ data.tar.gz: a5769ffed7a3d92f28959821e68890acfcedb84afe072771416a2ca602b023aa
5
5
  SHA512:
6
- metadata.gz: b54bb13296d6478788e75d4f4bbad4e18458332a3a3bf307492780a09ce63c7f0c4ca842e94837ee8fcf22250310e31dd1ab1fb6ef710feb4427904fd0a4f0b4
7
- data.tar.gz: 42871e89565265eb5d696ec6a69939b0488b6199b16e8a6edaf1985b2c664eeaa3069147222e73ed9297b490a9f3edbd4b327058bea8c7d3065e388c1430a78f
6
+ metadata.gz: 7410802842bb6dcbf949cf63cba86c429430e4aa8a8fe901fbe30a2ff9ff475278c64440e84296795f0f25528fc43780e0c1b46a6c46552ca930ae9a8085d1a5
7
+ data.tar.gz: 5221fd2ea871f4ec29864c29e975ff623c75d85afe36a5a1a9fad86f39eb9d5a1cb886d3c261f00792eb515589c49f5ce5a246471ad5c2e0befc0dd5853fbc93
data/Cargo.lock CHANGED
@@ -63,7 +63,7 @@ dependencies = [
63
63
 
64
64
  [[package]]
65
65
  name = "corvus-json-schema"
66
- version = "0.1.3"
66
+ version = "0.1.4"
67
67
  dependencies = [
68
68
  "regex",
69
69
  "regress",
@@ -72,7 +72,7 @@ dependencies = [
72
72
 
73
73
  [[package]]
74
74
  name = "corvus_json_schema"
75
- version = "0.1.0"
75
+ version = "0.1.1"
76
76
  dependencies = [
77
77
  "corvus-json-schema",
78
78
  "magnus",
data/VERSIONHISTORY.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  The version history of the `corvus_json_schema` Ruby gem. It is versioned independently of the Corvus NuGet packages and of the [corvus-json-schema](../../src-rs/corvus-json-schema/VERSIONHISTORY.md) Rust crate it is built on.
4
4
 
5
+ ## V0.1.1
6
+
7
+ V0.1.1 fixes wrong validation results for one form of pattern, by taking version 0.1.4 of the corvus-json-schema crate. There are no API changes. Version 0.1.0 is affected.
8
+
9
+ ### Bug fixes
10
+
11
+ - **A pattern of the form `^(?=[^SET]+$)(?=(.*\w)).+$` with a character outside ASCII in its excluded set.** The crate matches this form without a regular expression engine and keeps the excluded set as one bit for each ASCII character. A member outside ASCII, such as `é` in `^(?=[^é]+$)(?=(.*\w)).+$`, was read one UTF-8 byte at a time, and set the bits of unrelated ASCII characters (`C` and `)` for `é`). A validator compiled from such a schema rejected valid strings (`"C1"`) and accepted invalid ones (`"é1"`), with no error. Such a pattern is now matched by the regular expression engine. A pattern of this form whose excluded set is all ASCII was never affected.
12
+
5
13
  ## V0.1.0
6
14
 
7
15
  The first release: a native extension over the corvus-json-schema Rust crate (0.1.3), for drafts 4, 6, 7, 2019-09 and 2020-12. It reads Ruby values in place, validates JSON text without creating Ruby objects for it, and collects results (Basic, Detailed and Verbose) and annotations. It passes the whole JSON-Schema-Test-Suite, read in place, as JSON text and through a collector.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "corvus_json_schema"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  edition = "2024"
5
5
  rust-version = "1.85"
6
6
  description = "The native extension of the corvus_json_schema gem: the corvus-json-schema crate, reading Ruby values in place."
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
12
12
 
13
13
  [dependencies]
14
14
  # The crate, copied in by `rake vendor` (from src-rs/corvus-json-schema) so that the source gem builds on its own.
15
- corvus = { package = "corvus-json-schema", path = "vendor/corvus-json-schema", version = "0.1.3" }
15
+ corvus = { package = "corvus-json-schema", path = "vendor/corvus-json-schema", version = "0.1.4" }
16
16
  magnus = { version = "0.9.1", features = ["rb-sys"] }
17
17
  rb-sys = "0.9.130"
18
18
  serde_json = { version = "1.0.151", features = ["preserve_order", "float_roundtrip"] }
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "corvus-json-schema"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  edition = "2024"
5
5
  rust-version = "1.85"
6
6
  description = "A high-performance JSON Schema evaluator (draft 4 to 2020-12) with results collection and annotations, ported from the Corvus.Text.Json V5 runtime evaluator."
@@ -1008,6 +1008,11 @@ fn parse_class(b: &[u8], mut i: usize) -> Option<(CharSet, usize)> {
1008
1008
  return None; // `[]` / `[^]`
1009
1009
  }
1010
1010
  first = false;
1011
+ // The set holds ASCII members only. A member outside ASCII leaves the pattern to the engine: a byte of 128
1012
+ // or more is not a bit of the set, and shifting by it overflows.
1013
+ if !c.is_ascii() {
1014
+ return None;
1015
+ }
1011
1016
  // One atom: a single character (for ranges) or a set escape.
1012
1017
  let (atom, single, next) = match c {
1013
1018
  b'\\' => {
@@ -1035,7 +1040,7 @@ fn parse_class(b: &[u8], mut i: usize) -> Option<(CharSet, usize)> {
1035
1040
  h
1036
1041
  }
1037
1042
  };
1038
- if lo > hi {
1043
+ if lo > hi || !hi.is_ascii() {
1039
1044
  return None;
1040
1045
  }
1041
1046
  set = set.union(CharSet::range(lo, hi));
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CorvusJsonSchema
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corvus_json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - endjin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-02 00:00:00.000000000 Z
11
+ date: 2026-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys