From 9495e3e472322aa53c1d4f22e8eccd28528cedce Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 28 Jun 2022 13:40:19 +1200 Subject: [PATCH 1/2] remove conditional $id tests from draft 6 --- tests/draft6/id.json | 62 -------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/tests/draft6/id.json b/tests/draft6/id.json index b03248b2..e7e2e4bc 100644 --- a/tests/draft6/id.json +++ b/tests/draft6/id.json @@ -48,67 +48,5 @@ "valid": false } ] - }, - { - "description": "non-schema object containing a plain-name $id property", - "schema": { - "$defs": { - "const_not_anchor": { - "const": { - "$id": "#not_a_real_anchor" - } - } - }, - "if": { - "const": "skip not_a_real_anchor" - }, - "then": true, - "else" : { - "$ref": "#/$defs/const_not_anchor" - } - }, - "tests": [ - { - "description": "skip traversing definition for a valid result", - "data": "skip not_a_real_anchor", - "valid": true - }, - { - "description": "const at const_not_anchor does not match", - "data": 1, - "valid": false - } - ] - }, - { - "description": "non-schema object containing an $id property", - "schema": { - "$defs": { - "const_not_id": { - "const": { - "$id": "not_a_real_id" - } - } - }, - "if": { - "const": "skip not_a_real_id" - }, - "then": true, - "else" : { - "$ref": "#/$defs/const_not_id" - } - }, - "tests": [ - { - "description": "skip traversing definition for a valid result", - "data": "skip not_a_real_id", - "valid": true - }, - { - "description": "const at const_not_id does not match", - "data": 1, - "valid": false - } - ] } ] From 5aff83e5f6470879eb3afae3e4a5b1ad5455aeb0 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 28 Jun 2022 13:52:12 +1200 Subject: [PATCH 2/2] reintroduce tests without using if/then/else --- tests/draft6/id.json | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/tests/draft6/id.json b/tests/draft6/id.json index e7e2e4bc..0cbff5a9 100644 --- a/tests/draft6/id.json +++ b/tests/draft6/id.json @@ -48,5 +48,87 @@ "valid": false } ] + }, + { + "description": "non-schema object containing a plain-name $id property", + "schema": { + "$defs": { + "const_not_anchor": { + "const": { + "$id": "#not_a_real_anchor" + } + } + }, + "oneOf": [ + { + "const": "skip not_a_real_anchor" + }, + { + "allOf": [ + { + "not": { + "const": "skip not_a_real_anchor" + } + }, + { + "$ref": "#/$defs/const_not_anchor" + } + ] + } + ] + }, + "tests": [ + { + "description": "skip traversing definition for a valid result", + "data": "skip not_a_real_anchor", + "valid": true + }, + { + "description": "const at const_not_anchor does not match", + "data": 1, + "valid": false + } + ] + }, + { + "description": "non-schema object containing an $id property", + "schema": { + "$defs": { + "const_not_id": { + "const": { + "$id": "not_a_real_id" + } + } + }, + "oneOf": [ + { + "const":"skip not_a_real_id" + }, + { + "allOf": [ + { + "not": { + "const": "skip not_a_real_id" + } + }, + { + "$ref": "#/$defs/const_not_id" + } + ] + } + ] + }, + "tests": [ + { + "description": "skip traversing definition for a valid result", + "data": "skip not_a_real_id", + "valid": true + }, + { + "description": "const at const_not_id does not match", + "data": 1, + "valid": false + } + ] } ]