teptris 0.3.24.0-x86_64-linux → 0.3.26.0-x86_64-linux
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/ext/teptris_ext/engine/README.md +1 -1
- data/ext/teptris_ext/engine/src/include/teptris/version.h +2 -2
- data/ext/teptris_ext/engine/src/teptris/schema/json_read.c +6 -2
- data/ext/teptris_ext/engine/src/teptris/schema/schema.c +21 -6
- data/ext/teptris_ext/engine/src/teptris/schema/schema_internal.h +4 -0
- data/lib/teptris/3.3/teptris_ext.so +0 -0
- data/lib/teptris/3.4/teptris_ext.so +0 -0
- data/lib/teptris/4.0/teptris_ext.so +0 -0
- data/lib/teptris/version.rb +1 -1
- 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: d599a5fa9fed69df9908f618cc17399d2b9388ca4534020e641d663f4722b6ab
|
|
4
|
+
data.tar.gz: da4e27d4fd75f7dc3b064cae7f7525703b2533555c076f2e4a6e50f4d58de909
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f33a54ff7bd601c24c904a4f30a1c7cc1a6eabfef32ad78e42aafaf299d01c3d044b6a14d4cce99581ecaefca7902b0883d817424c803553a0f1199788ecf519
|
|
7
|
+
data.tar.gz: 0b9a46ce3833144213a50b3f59be06abb0c43207d1a2c403ac6a7f00025ff238430082e0e4e88c9dc130c0360ef827a6abb6c0bac1206d93f9adcf578b8a3402
|
|
@@ -186,9 +186,13 @@ static const char *jstring(jctx *c, size_t *out_len) {
|
|
|
186
186
|
return s;
|
|
187
187
|
}
|
|
188
188
|
/* escaped string: rebuild into arena memory, carrying the plain
|
|
189
|
-
* prefix the fast scan already stepped over
|
|
189
|
+
* prefix the fast scan already stepped over. Every remaining
|
|
190
|
+
* input byte yields at most one output byte (plain chars are
|
|
191
|
+
* 1:1, escapes consume >=2 input per <=4 output), so the whole
|
|
192
|
+
* remaining span is the tight bound — sizing from the prefix
|
|
193
|
+
* alone overflows on a long plain tail (ASan, nightly 2026-11-06). */
|
|
190
194
|
size_t plain_len = c->pos - start;
|
|
191
|
-
size_t cap = (c->
|
|
195
|
+
size_t cap = (c->len - start) + 16;
|
|
192
196
|
char *out = teptris_arena_alloc(c->a, cap);
|
|
193
197
|
size_t n = plain_len;
|
|
194
198
|
memcpy(out, c->src + start, plain_len);
|
|
@@ -1151,8 +1151,12 @@ sch_node *sch_compile_node(sctx *c, const jv *v) {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
n->dynamic_recursive = recursive;
|
|
1153
1153
|
} else if (strcmp(k, "contentSchema") == 0) {
|
|
1154
|
-
|
|
1155
|
-
|
|
1154
|
+
if (!c->dialect_declared) {
|
|
1155
|
+
n->content_schema = sch_compile_node(c, val);
|
|
1156
|
+
if (n->content_schema == NULL && c->err[0] != '\0') return NULL;
|
|
1157
|
+
}
|
|
1158
|
+
/* annotation under an explicit dialect (2020-12 content
|
|
1159
|
+
* vocabulary: assertions SHOULD NOT be made) */
|
|
1156
1160
|
} else if (strcmp(k, "required") == 0 &&
|
|
1157
1161
|
jv_kind_of(val) == JV_ARRAY) {
|
|
1158
1162
|
size_t cnt = jv_item_count(val);
|
|
@@ -1224,10 +1228,10 @@ sch_node *sch_compile_node(sctx *c, const jv *v) {
|
|
|
1224
1228
|
}
|
|
1225
1229
|
} else if (strcmp(k, "contentEncoding") == 0 &&
|
|
1226
1230
|
jv_kind_of(val) == JV_STRING) {
|
|
1227
|
-
n->content_encoding = jv_str(val);
|
|
1231
|
+
if (!c->dialect_declared) n->content_encoding = jv_str(val);
|
|
1228
1232
|
} else if (strcmp(k, "contentMediaType") == 0 &&
|
|
1229
1233
|
jv_kind_of(val) == JV_STRING) {
|
|
1230
|
-
n->content_media_type = jv_str(val);
|
|
1234
|
+
if (!c->dialect_declared) n->content_media_type = jv_str(val);
|
|
1231
1235
|
} else if (strcmp(k, "items") == 0 && jv_kind_of(val) == JV_ARRAY) {
|
|
1232
1236
|
/* draft-07 tuple form: positional prefixes; the union
|
|
1233
1237
|
* reads them exactly like prefixItems, with
|
|
@@ -1300,7 +1304,11 @@ sch_node *sch_compile_node(sctx *c, const jv *v) {
|
|
|
1300
1304
|
if (!count_value(c, val, &n->max_length)) return NULL;
|
|
1301
1305
|
n->has_max_length = true;
|
|
1302
1306
|
} else if (strcmp(k, "format") == 0 && jv_kind_of(val) == JV_STRING) {
|
|
1303
|
-
|
|
1307
|
+
if (!c->dialect_declared) {
|
|
1308
|
+
n->format = format_kind(jv_str(val));
|
|
1309
|
+
}
|
|
1310
|
+
/* an explicit dialect keeps the spec's annotation-only
|
|
1311
|
+
* default: the keyword rides the ignored tail */
|
|
1304
1312
|
} else if ((strcmp(k, "minimum") == 0 || strcmp(k, "maximum") == 0 ||
|
|
1305
1313
|
strcmp(k, "exclusiveMinimum") == 0 ||
|
|
1306
1314
|
strcmp(k, "exclusiveMaximum") == 0) &&
|
|
@@ -1511,7 +1519,11 @@ static teptris_status schema_compile_core(const char *json, size_t len,
|
|
|
1511
1519
|
c.cur_dir = held;
|
|
1512
1520
|
}
|
|
1513
1521
|
/* draft 07 and older make a $ref ignore its siblings; 2019-09+
|
|
1514
|
-
* evaluate $ref alongside them. The root's $schema decides.
|
|
1522
|
+
* evaluate $ref alongside them. The root's $schema decides. A
|
|
1523
|
+
* standard draft dialect switches format/content* to the spec's
|
|
1524
|
+
* annotation-only default; the format-assertion dialect URI opts
|
|
1525
|
+
* back in, and the no-dialect default asserts (the practical
|
|
1526
|
+
* mode every real-world manifest relies on). */
|
|
1515
1527
|
if (jv_kind_of(root) == JV_OBJECT) {
|
|
1516
1528
|
jv *sv = jv_member_get(root, "$schema");
|
|
1517
1529
|
if (sv != NULL && jv_kind_of(sv) == JV_STRING) {
|
|
@@ -1520,6 +1532,9 @@ static teptris_status schema_compile_core(const char *json, size_t len,
|
|
|
1520
1532
|
strstr(s, "draft-07") != NULL) {
|
|
1521
1533
|
c.ref_exclusive = true;
|
|
1522
1534
|
}
|
|
1535
|
+
if (strstr(s, "format-assertion") == NULL) {
|
|
1536
|
+
c.dialect_declared = true;
|
|
1537
|
+
}
|
|
1523
1538
|
}
|
|
1524
1539
|
}
|
|
1525
1540
|
|
|
@@ -226,6 +226,10 @@ typedef struct {
|
|
|
226
226
|
/* which standard vocabularies the dialect keeps (8.1.2: a custom
|
|
227
227
|
* metaschema's $vocabulary decides; absent = all of them) */
|
|
228
228
|
unsigned vocab_mask;
|
|
229
|
+
/* an explicit root $schema declares the dialect: format and
|
|
230
|
+
* content* then follow the spec's annotation-only default. No
|
|
231
|
+
* $schema means teptris's practical default: assert. */
|
|
232
|
+
bool dialect_declared;
|
|
229
233
|
/* standard vocabulary gates (the core vocabulary is mandatory and
|
|
230
234
|
* never gated) */
|
|
231
235
|
#define TEPTRIS_VOC_APPLICATOR 1u
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/teptris/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: teptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.26.0
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- teptris contributors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A native C extension over libteptris, a C99 TOML 1.1 parser/emitter.
|
|
14
14
|
API shape mirrors the tomlib gem.
|