From 6695ca38536a713c5427e790d00e670c80df8cf6 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 26 Oct 2023 09:52:11 +1300 Subject: [PATCH 1/2] add optional tests for `$ref`ing into known non-applicator keywords --- .../optional/refOfUnknownKeyword.json | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/draft-next/optional/refOfUnknownKeyword.json b/tests/draft-next/optional/refOfUnknownKeyword.json index 489701cd..c832e09f 100644 --- a/tests/draft-next/optional/refOfUnknownKeyword.json +++ b/tests/draft-next/optional/refOfUnknownKeyword.json @@ -42,5 +42,28 @@ "valid": false } ] + }, + { + "description": "reference internals of known non-applicator", + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "$id": "/base", + "examples": [ + { "type": "string" } + ], + "$ref": "#/examples/0" + }, + "tests": [ + { + "description": "match", + "data": "a string", + "valid": true + }, + { + "description": "mismatch", + "data": 42, + "valid": false + } + ] } ] From fea2cf192ebd7d381628884dc20f1c3d2d98754c Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 27 Oct 2023 08:52:02 +1300 Subject: [PATCH 2/2] add tests for 2019 and 2020 --- .../optional/refOfUnknownKeyword.json | 23 +++++++++++++++++++ .../optional/refOfUnknownKeyword.json | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/tests/draft2019-09/optional/refOfUnknownKeyword.json b/tests/draft2019-09/optional/refOfUnknownKeyword.json index eee1c33e..e9a75dd1 100644 --- a/tests/draft2019-09/optional/refOfUnknownKeyword.json +++ b/tests/draft2019-09/optional/refOfUnknownKeyword.json @@ -42,5 +42,28 @@ "valid": false } ] + }, + { + "description": "reference internals of known non-applicator", + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "/base", + "examples": [ + { "type": "string" } + ], + "$ref": "#/examples/0" + }, + "tests": [ + { + "description": "match", + "data": "a string", + "valid": true + }, + { + "description": "mismatch", + "data": 42, + "valid": false + } + ] } ] diff --git a/tests/draft2020-12/optional/refOfUnknownKeyword.json b/tests/draft2020-12/optional/refOfUnknownKeyword.json index f91c1888..c2b080a1 100644 --- a/tests/draft2020-12/optional/refOfUnknownKeyword.json +++ b/tests/draft2020-12/optional/refOfUnknownKeyword.json @@ -42,5 +42,28 @@ "valid": false } ] + }, + { + "description": "reference internals of known non-applicator", + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/base", + "examples": [ + { "type": "string" } + ], + "$ref": "#/examples/0" + }, + "tests": [ + { + "description": "match", + "data": "a string", + "valid": true + }, + { + "description": "mismatch", + "data": 42, + "valid": false + } + ] } ]