From b097dda8466e5650d3fac4c87ea69ce772f57ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 14 Sep 2021 03:52:20 +0300 Subject: [PATCH 1/2] fix: specify the currently used draft uri to schemasafe --- validators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validators.js b/validators.js index be72793..f1a291c 100644 --- a/validators.js +++ b/validators.js @@ -300,7 +300,7 @@ module.exports = async function valivators(draftUri, draftVersion) { allowUnusedKeywords: true, includeErrors: true, schemas: refs, - $schemaDefault: "https://json-schema.org/draft-06/schema", + $schemaDefault: draftUri, }); }, test: function(instance, json, schema) { From c79e8f81af0945aebef91baffc51d881eedad02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 14 Sep 2021 03:53:25 +0300 Subject: [PATCH 2/2] fix: disable more schemasafe precautions for ill-formed schemas --- validators.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/validators.js b/validators.js index f1a291c..52a34dc 100644 --- a/validators.js +++ b/validators.js @@ -297,7 +297,9 @@ module.exports = async function valivators(draftUri, draftVersion) { name: "@exodus/schemasafe", setup: function(schema) { return schemasafe.validator(schema, { + // some tests are ill-formed on a purpose, we disable bail-out on those to check the actual behavior allowUnusedKeywords: true, + allowUnreachable: true, includeErrors: true, schemas: refs, $schemaDefault: draftUri,