Skip to content

Commit a0f67b7

Browse files
authored
Enable more Draft 3 official tests (#777)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 8c777a9 commit a0f67b7

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 95fec2442e66b3de6651972e5f7d4635ca6f7ff9 Mon Sep 17 00:00:00 2001
2+
From: Juan Cruz Viotti <jv@jviotti.com>
3+
Date: Tue, 5 May 2026 09:15:10 -0400
4+
Subject: [PATCH] Do not use `definitions` sibling to `$ref` in `ref.json` for
5+
Draft 3
6+
7+
I'm extending Blaze to support Draft 3. As per the spec (applies to all drafts up to 7), a `$ref` overrides any sibling keyword. This seems to be the only case in the test suite where we do this.
8+
---
9+
tests/draft3/ref.json | 4 +++-
10+
1 file changed, 3 insertions(+), 1 deletion(-)
11+
12+
diff --git a/tests/draft3/ref.json b/tests/draft3/ref.json
13+
index 609eaa46..6686c78e 100644
14+
--- a/tests/draft3/ref.json
15+
+++ b/tests/draft3/ref.json
16+
@@ -127,7 +127,9 @@
17+
"b": {"$ref": "#/definitions/a"},
18+
"c": {"$ref": "#/definitions/b"}
19+
},
20+
- "$ref": "#/definitions/c"
21+
+ "extends": {
22+
+ "$ref": "#/definitions/c"
23+
+ }
24+
},
25+
"tests": [
26+
{

test/evaluator/officialsuite.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,7 @@ int main(int argc, char **argv) {
420420
register_tests("draft3", "JSONSchemaOfficialSuite_Draft3",
421421
"http://json-schema.org/draft-03/schema#",
422422
// TODO: Enable all tests
423-
{"disallow", "enum", "extends", "infinite-loop-detection",
424-
"ref", "refRemote", "required"});
423+
{"disallow", "enum", "extends", "required"});
425424
register_tests(std::filesystem::path{"draft3"} / "optional",
426425
"JSONSchemaOfficialSuite_Draft3_Optional",
427426
"http://json-schema.org/draft-03/schema#", {});

vendor/jsonschema-test-suite/tests/draft3/ref.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)