summaryrefslogtreecommitdiff
path: root/schemas
diff options
context:
space:
mode:
authorNicolai Cornelis <[email protected]>2024-10-26 03:42:58 +0200
committerNicolai Cornelis <[email protected]>2024-10-26 03:42:58 +0200
commite2fd52ee6d3b9cc9dad0e0df4578b63bcdaa2738 (patch)
treecf3c27c9f4e02e400bb00e0a4ea3fdb3939f53ef /schemas
parent7c91597496ea58016e52ab232352d219d47cadbf (diff)
Remove inline schema ref
Fix invalid metrics examples Adjust workflow file
Diffstat (limited to 'schemas')
-rw-r--r--schemas/test.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/schemas/test.js b/schemas/test.js
index d0e6f8d2..cd469c3a 100644
--- a/schemas/test.js
+++ b/schemas/test.js
@@ -12,7 +12,7 @@ function stripIds(schema, first) {
delete schema.$schema;
}
for (const key in schema) {
- if (schema.hasOwnProperty(key)) {
+ if (Object.hasOwn(schema, key)) {
stripIds(schema[key], false);
}
}
@@ -25,7 +25,7 @@ const dereferenced = await $RefParser.dereference('./config/3.0.schema.json');
// Remove $id and $schema from anything but the root
stripIds(dereferenced, true);
-const ajv = new Ajv2019({strict: true})
+const ajv = new Ajv2019({strict: true, allErrors: true})
const validator = ajv.compile(dereferenced)
const data = fs.readFileSync('../.rr.yaml', 'utf-8');
@@ -33,5 +33,7 @@ const schema = yaml.load(data);
// Validate the file
if (!validator(schema)) {
- throw new Error("Errors: " + JSON.stringify(validator.errors))
+ throw new Error(JSON.stringify(validator.errors, null, 2))
+} else {
+ console.log('No errors found in schemas.')
}