From d5e34a0cf8cdaa833d69697edee04dbe188578cc Mon Sep 17 00:00:00 2001 From: stan-sb <67116470+stan-sb@users.noreply.github.com> Date: Fri, 19 Jun 2020 09:16:43 -0400 Subject: [PATCH 1/2] Issue-949: Fixing inconsistencies in output schema 1. Changing "oneOf" to "anyOf", because basic, detailed and verbose have the same definition, oneOf would fail validation. 2. Adding "error" keyword and making either "error" or "errors" required in case "valid" is false. --- output/schema.json | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/output/schema.json b/output/schema.json index dce6fc0b..e3824ffc 100644 --- a/output/schema.json +++ b/output/schema.json @@ -3,7 +3,7 @@ "$id": "https://json-schema.org/draft/2019-09/output/schema", "description": "A schema that validates the minimum requirements for validation output", - "oneOf": [ + "anyOf": [ { "$ref": "#/$defs/flag" }, { "$ref": "#/$defs/basic" }, { "$ref": "#/$defs/detailed" }, @@ -25,6 +25,9 @@ "type": "string", "format": "uri-reference" }, + "error": { + "type": "string" + }, "errors": { "$ref": "#/$defs/outputUnitArray" }, @@ -41,7 +44,14 @@ } }, "then": { - "required": [ "errors" ] + "oneOf": [ + { + "required": [ "error" ] + }, + { + "required": [ "errors" ] + } + ] } }, { From fd25a79d93d6c718437eaa0eb9e7f7f6aab5c382 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 1 Oct 2020 14:41:53 -0700 Subject: [PATCH 2/2] Update output/schema.json Make anyOf (instead of oneOf) consistent. --- output/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/schema.json b/output/schema.json index e3824ffc..97beaeee 100644 --- a/output/schema.json +++ b/output/schema.json @@ -44,7 +44,7 @@ } }, "then": { - "oneOf": [ + "anyOf": [ { "required": [ "error" ] },