From 16a3af07efba3a500ca4795048df213df3b856c4 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 17 Aug 2020 00:20:04 +0300 Subject: [PATCH] Hide ajv warning about ignored keywords This was showing up when using $ref with $comment in the JSON Schema --- src/cfg.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cfg.js b/src/cfg.js index 2d91e8c..69e12a6 100644 --- a/src/cfg.js +++ b/src/cfg.js @@ -149,7 +149,11 @@ for (const [key, value] of Object.entries(config)) { } // Validate config and assign defaults (if missing) -const ajv = new Ajv({ useDefaults: true, coerceTypes: "array" }); +const ajv = new Ajv({ + useDefaults: true, + coerceTypes: "array", + extendRefs: true, // Hides an error about ignored keywords when using $ref with $comment +}); // https://github.com/ajv-validator/ajv/issues/141#issuecomment-270692820 const truthyValues = ["1", "true", "on", "yes"];