From 90c9abc62e3014e01f26ff1c41e87c9d5953199d Mon Sep 17 00:00:00 2001 From: kschri201_comcast Date: Wed, 8 May 2024 15:38:02 -0400 Subject: [PATCH 1/2] fix: Update ajv version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99fa850e..446b04b5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ ], "license": "Apache-2.0", "dependencies": { - "ajv": "^8.3.0", + "ajv": "^8.13.0", "ajv-formats": "^2.1.0", "array.prototype.groupby": "^1.1.0", "crocks": "^0.12.4", From 99bdba0fed7a1a2092ed9ce7a59f24f4d5af62fd Mon Sep 17 00:00:00 2001 From: kschri201_comcast Date: Wed, 8 May 2024 16:15:47 -0400 Subject: [PATCH 2/2] fix: Account for new openRpcSpec URL contents --- package.json | 2 +- src/validate/index.mjs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 446b04b5..99fa850e 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ ], "license": "Apache-2.0", "dependencies": { - "ajv": "^8.13.0", + "ajv": "^8.3.0", "ajv-formats": "^2.1.0", "array.prototype.groupby": "^1.1.0", "crocks": "^0.12.4", diff --git a/src/validate/index.mjs b/src/validate/index.mjs index 629b5f69..f9002554 100644 --- a/src/validate/index.mjs +++ b/src/validate/index.mjs @@ -73,10 +73,13 @@ const run = async ({ const jsonSchemaSpec = await (await fetch('https://meta.json-schema.tools')).json() // - OpenRPC uses `additionalItems` when `items` is not an array of schemas. This fails strict validate, so we remove it - // - OpenRPC uses raw.githubusercontent.com URLs for the json-schema spec, we replace this with the up to date spec on meta.json-schema.tools const openRpcSpec = await (await fetch('https://meta.open-rpc.org')).json() + removeIgnoredAdditionalItems(openRpcSpec) - replaceUri('https://raw.githubusercontent.com/json-schema-tools/meta-schema/1.5.9/src/schema.json', 'https://meta.json-schema.tools/', openRpcSpec) + + //AJV doesn't like not having a slash at the end of the URL + replaceUri('https://meta.json-schema.tools', 'https://meta.json-schema.tools/', openRpcSpec) + Object.values(sharedSchemas).forEach(schema => { try {