From 611dc8236d3b2afac07a5c40def0dbaf91f57745 Mon Sep 17 00:00:00 2001 From: Marco Duca Date: Fri, 20 Sep 2024 12:52:06 +0200 Subject: [PATCH] Adjusted some settings to incopatibility with the new version of the AVJ library --- app.js | 5 +++-- config/services-schema.json | 2 +- package-lock.json | 31 +++++++++++++++++-------------- package.json | 1 + 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/app.js b/app.js index 2bb59ae..baa417f 100644 --- a/app.js +++ b/app.js @@ -17,7 +17,8 @@ var cert = properties.path.cert; var servicesConfig = require("./config/services.json"); // This function validates the JSON schemas -var Ajv = require("ajv"); +var Ajv = require("ajv"); +const addFormats = require("ajv-formats"); validateJsonSchemas(); // Prepare the languages array to give to the clients @@ -187,8 +188,8 @@ function validateSchema(jsonPath, schemaPath) { // Config var ajv = new Ajv({ allErrors: true, - jsonPointers: true, }); + addFormats(ajv); // Compiling the schema var compiledSchema = ajv.compile(schema); diff --git a/config/services-schema.json b/config/services-schema.json index 35af128..be4d617 100644 --- a/config/services-schema.json +++ b/config/services-schema.json @@ -178,7 +178,7 @@ "title": "Executor path.", "description": "This property indicates the executor path relative to its URL.", "type": "string", - "_comment": "Add the pattern to match with the 'path'." + "$comment": "Add the pattern to match with the 'path'." }, "port": { "title": "Connection port number.", diff --git a/package-lock.json b/package-lock.json index 834e88c..79c5296 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", "json-pointer": "^0.6.2", "socket.io": "^4.7.5", "websocket": "^1.0.35" @@ -74,6 +75,22 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -304,20 +321,6 @@ "node": ">=0.10" } }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/esniff/node_modules/type": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", diff --git a/package.json b/package.json index 46a7950..16c8c6e 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ }, "dependencies": { "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", "json-pointer": "^0.6.2", "socket.io": "^4.7.5", "websocket": "^1.0.35"