corvus_json_schema 0.1.4-aarch64-linux-gnu → 0.2.0-aarch64-linux-gnu

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: a005889700268ed1b249c904130f09ad5b443c0d4e60ea1c408bcb6f2f9eaa42
4
- data.tar.gz: 1fd0a84693be39d19bd17f4656ebf773e59a08179a101a36018d59d476122025
3
+ metadata.gz: 1261db29344a5a875d88f34058ef33484dcf53d41e25fa4c52c93d54ec2159ae
4
+ data.tar.gz: 7b2476f0f749ad9922263b507e85bfc28bb81c36c4f085bccec885cfa3394072
5
5
  SHA512:
6
- metadata.gz: 1be3876a9d85e89164ebdfa9ee970890b2a8a0cb495481faad190e54b8b6336cc4c869a8ebaaba51b7b70eb93384f1598e628dca041f1bc32ec1ad18811a9b6f
7
- data.tar.gz: fabad5e14e6b20ecd2b05df8e6e89ff0c68c3f4b094a737efcaadd10905ff0b9fac4141bc24ad3ff78ddea4d4699067a73ae629a3df732c3cc740fd15cf58578
6
+ metadata.gz: f6e8908eb1d392fc099c63dc4ad7b8b36af5af84b18f353f7f3694a07e68044ccbd93bfd1167046d5fad6639015e5e04da01e80cf43ae9b9c9c370616c8db10b
7
+ data.tar.gz: e03a0c1bb986dc365db591467f9532175d4cedd650ce1c2db94b39848229707c69b23c796772b2603b0c57d0be0d29287b515a77e5a6d72d03bb24febd8e2d5d
data/README.md CHANGED
@@ -54,6 +54,8 @@ Its options:
54
54
  | `entry_point` | `nil` | A reference to the subschema to validate against, such as `"#/$defs/item"`. |
55
55
  | `max_depth` | `128` | The deepest the evaluator recurses in place before it raises `DepthError`. |
56
56
  | `pattern_match_limit` | `1.0` | The seconds one match of a `pattern` or `patternProperties` regular expression against one string may take before the validation raises `PatternMatchLimitError`. `nil` or `0` turns the limit off, for a caller who trusts both the schema and the instances. |
57
+ | `regex_edition` | `:dialect` | The edition of ECMA-262 `pattern`, `patternProperties` and the `regex` format are read with: `:dialect` (ECMAScript 2020 for 2019-09 and 2020-12, which name it, today's for the drafts before them), `:current` or `:es2020`. Under ECMAScript 2020 a modifier group such as `(?i:...)` is not valid. |
58
+ | `regex_unicode_version` | `:default` | The version of Unicode patterns are read with: `:default` (the version of the V8 the answers are held to, 17 today), `:latest`, `13`, `17` or `18`. |
57
59
 
58
60
  A `Validator` is immutable and can be shared between threads.
59
61
 
@@ -114,7 +116,7 @@ repository's submodule (or `JSON_SCHEMA_TEST_SUITE`).
114
116
 
115
117
  Apache-2.0
116
118
 
117
- The gem is built on the `corvus-json-schema` Rust crate, whose Unicode tables are derived from the Unicode Character
118
- Database, which is under the Unicode License V3. [THIRD-PARTY-NOTICES.txt](THIRD-PARTY-NOTICES.txt) has that notice,
119
- and the one of the `regress` crate that the tables were first read from. The file is in the source gem and in every
120
- native gem, beside `LICENSE`.
119
+ The gem is built on the `corvus-json-schema` Rust crate, which matches patterns with the `corvus-regex-ecma262` crate,
120
+ whose Unicode tables are derived from the Unicode Character Database, which is under the Unicode License V3.
121
+ [THIRD-PARTY-NOTICES.txt](THIRD-PARTY-NOTICES.txt) has that notice, and the one of the `regress` crate, from whose
122
+ tables those were written. The file is in the source gem and in every native gem, beside `LICENSE`.
@@ -13,14 +13,16 @@ License notice for the Unicode Character Database
13
13
 
14
14
  The gem is built on the corvus-json-schema Rust crate. The source gem holds
15
15
  the crate's sources (ext/corvus_json_schema/vendor/corvus-json-schema), and a
16
- native gem holds the extension compiled from them. src/ecmaregex/tables_gen.rs
17
- of that crate holds tables derived from the data files of the Unicode
18
- Character Database, version 17.0.0
19
- (https://www.unicode.org/Public/17.0.0/ucd/): the General_Category values, the
20
- binary properties, the Script and Script_Extensions values, the simple case
21
- folding and the simple uppercase mapping. The data files are "© 2025 Unicode®,
22
- Inc." and are licensed under the Unicode License V3 (SPDX-License-Identifier:
23
- Unicode-3.0), as https://www.unicode.org/license.txt gives it:
16
+ native gem holds the extension compiled from them. That crate matches patterns
17
+ with the corvus-regex-ecma262 crate, which is compiled in with it.
18
+ corvus-regex-ecma262 holds tables derived from the data files of the Unicode
19
+ Character Database, versions 13.0.0, 17.0.0 and 18.0.0
20
+ (https://www.unicode.org/Public/), and from its emoji sequence files: the
21
+ General_Category values, the binary properties, the Script and
22
+ Script_Extensions values, the simple case folding, the simple uppercase
23
+ mapping and the properties of strings. The data files are licensed under the
24
+ Unicode License V3 (SPDX-License-Identifier: Unicode-3.0), as
25
+ https://www.unicode.org/license.txt gives it:
24
26
 
25
27
  UNICODE LICENSE V3
26
28
 
@@ -65,12 +67,11 @@ authorization of the copyright holder.
65
67
  License notice for https://github.com/ridiculousfish/regress
66
68
  -------------------------------
67
69
 
68
- The tables of src/ecmaregex/tables_gen.rs of the corvus-json-schema crate were
69
- written from the tables of the Corvus Go module, which were written from
70
- src/unicodetables.rs of regress 0.12.0. That crate generates the file from the
71
- Unicode Character Database. regress is licensed under the MIT license or the
72
- Apache License, Version 2.0, at the user's option. Neither the gem nor the
73
- corvus-json-schema crate depends on it.
70
+ The tables of the corvus-regex-ecma262 crate were written, through the tables
71
+ of the Corvus Go module, from the property tables of regress (its gen-unicode
72
+ tool), which are generated from the Unicode Character Database. regress is
73
+ licensed under the MIT license or the Apache License, Version 2.0, at the
74
+ user's option. Neither the gem nor the crates it is built on depend on it.
74
75
 
75
76
  MIT License
76
77
 
data/VERSIONHISTORY.md CHANGED
@@ -2,6 +2,15 @@
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.2.0
6
+
7
+ V0.2.0 takes version 0.2.0 of the `corvus-json-schema` crate, which matches patterns with the [`corvus-regex-ecma262`](https://crates.io/crates/corvus-regex-ecma262) crate and reads them in the grammar of the dialect. It is a minor version because under 2019-09 and 2020-12 a pattern that uses what ECMAScript added after 2020 is no longer valid. Everything else that was there is unchanged, and there are two new options.
8
+
9
+ - **The grammar of the dialect.** JSON Schema 2019-09 and 2020-12 name the grammar of ECMAScript 2020, and patterns under them are now read with it: a modifier group such as `(?i:...)`, or a group name used by two groups, is not valid, and `CorvusJsonSchema.compile` raises `CompilationError` for a schema with one in a `pattern`. A property escape that the tables of 2020 do not have (`\p{Script=Yezidi}`) is not valid with the `u` flag, so the pattern is read without it, where `\p` is the letter `p`, as a pattern with `\&` is. The `regex` format reads only the grammar of the flag. Drafts 4 to 7 read today's grammar, as before.
10
+ - **`regex_edition:`** (`:dialect`, the default, `:current` or `:es2020`) chooses the edition for every dialect, and **`regex_unicode_version:`** (`:default`, the default, `:latest`, `13`, `17` or `18`) the version of Unicode. Another value raises `ArgumentError`.
11
+ - **The engine.** Every pattern that no dedicated matcher of the crate takes is matched by `corvus-regex-ecma262`, whose answers are V8's for the whole of the ECMA-262 regular expression test data. The limits are those of 0.1.4. Over the jsonschema-benchmark corpora the crate validates in 0.98 of the time of 0.1.7 once warm, and takes 1.06 of it for the first validation and 1.05 to compile, since the engine builds a pattern's automaton on its first match.
12
+ - **Notices.** `THIRD-PARTY-NOTICES.txt` names the tables of `corvus-regex-ecma262`, which the native gems now hold in place of the crate's own. The source gem no longer carries a copy of the crate's notice, which the crate no longer has.
13
+
5
14
  ## V0.1.4
6
15
 
7
16
  V0.1.4 takes version 0.1.7 of the `corvus-json-schema` crate. That fixes wrong results for several forms of pattern and a validation that did not end, replaces the crate's regular expression engine, and gives every match of a pattern a limit of time. The functions and types that were there are unchanged, and there are additions for the limit. Versions 0.1.0 to 0.1.3 are affected.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CorvusJsonSchema
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -39,16 +39,21 @@ module CorvusJsonSchema
39
39
  # "#/$defs/item"), max_depth (of in-place recursion, default 128) and pattern_match_limit (the seconds one match of
40
40
  # a pattern or patternProperties regular expression may take, default 1. A match that takes longer is abandoned and
41
41
  # the validation raises PatternMatchLimitError. nil or 0 turns the limit off, for a caller who trusts both the
42
- # schema and the instances).
42
+ # schema and the instances), regex_edition (the edition of ECMA-262 patterns are read with: :dialect, the default,
43
+ # which is ECMAScript 2020 for 2019-09 and 2020-12 and today's for the drafts before them, :current or :es2020) and
44
+ # regex_unicode_version (the version of Unicode they are read with: :default, Unicode 17 today, :latest, 13, 17 or
45
+ # 18).
43
46
  #
44
47
  # A schema that does not compile raises CompilationError, and one with a regular expression over a limit of size
45
48
  # (1,048,576 bytes of pattern, 1,000 levels of groups) raises PatternTooLargeError, which is a CompilationError.
46
49
  def self.compile(schema, default_dialect: :draft202012, assert_format: nil, assert_format_in_legacy_drafts: false,
47
50
  assert_content: true, formats: nil, resolver: nil, base_uri: nil, entry_point: nil, max_depth: 128,
48
- pattern_match_limit: DEFAULT_PATTERN_MATCH_LIMIT)
51
+ pattern_match_limit: DEFAULT_PATTERN_MATCH_LIMIT, regex_edition: :dialect,
52
+ regex_unicode_version: :default)
49
53
  dialect = DIALECTS.fetch(default_dialect) { raise ArgumentError, "unknown dialect #{default_dialect.inspect}" }
50
54
  Native.compile(schema, dialect, assert_format, assert_format_in_legacy_drafts, assert_content, formats, resolver,
51
- base_uri, entry_point, Integer(max_depth), pattern_match_limit&.to_f)
55
+ base_uri, entry_point, Integer(max_depth), pattern_match_limit&.to_f, regex_edition.to_s,
56
+ regex_unicode_version.to_s)
52
57
  end
53
58
 
54
59
  # The version of the corvus-json-schema crate the extension was built from.
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.4
4
+ version: 0.2.0
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - endjin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-17 00:00:00.000000000 Z
11
+ date: 2026-11-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'JSON Schema validation for Ruby with the corvus-json-schema Rust crate:
14
14
  drafts 4, 6, 7, 2019-09 and 2020-12, results and annotations, Ruby values read in