Hide ajv warning about ignored keywords

This was showing up when using $ref with $comment in the JSON Schema
cshd
Dragory 2020-08-17 00:20:04 +03:00
parent a327160ed9
commit 16a3af07ef
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 5 additions and 1 deletions

View File

@ -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"];