From dab94face273df67c8479bb0e5d7a1e094c4476c Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Mon, 15 Aug 2022 09:55:06 +1200 Subject: [PATCH] add draft 7 -> draft 2019-09 test --- remotes/draft2019-09/dependentRequired.json | 7 ++++++ tests/draft7/optional/cross-draft.json | 24 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 remotes/draft2019-09/dependentRequired.json create mode 100644 tests/draft7/optional/cross-draft.json diff --git a/remotes/draft2019-09/dependentRequired.json b/remotes/draft2019-09/dependentRequired.json new file mode 100644 index 00000000..0d691d96 --- /dev/null +++ b/remotes/draft2019-09/dependentRequired.json @@ -0,0 +1,7 @@ +{ + "$id": "http://localhost:1234/draft2019-09/dependentRequired.json", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "dependentRequired": { + "foo": ["bar"] + } +} diff --git a/tests/draft7/optional/cross-draft.json b/tests/draft7/optional/cross-draft.json new file mode 100644 index 00000000..a4314a2c --- /dev/null +++ b/tests/draft7/optional/cross-draft.json @@ -0,0 +1,24 @@ +[ + { + "description": "refs to future drafts are processed as future drafts", + "schema": { + "type": "object", + "allOf": [ + { "properties": { "foo": true } }, + { "$ref": "http://localhost:1234/draft2019-09/dependentRequired.json" } + ] + }, + "tests": [ + { + "description": "missing bar is invalid", + "data": {"foo": "any value"}, + "valid": false + }, + { + "description": "present bar is valid", + "data": {"foo": "any value", "bar": "also any value"}, + "valid": true + } + ] + } +]