Skip to content

Commit

Permalink
fix: Account for new openRpcSpec URL contents
Browse files Browse the repository at this point in the history
  • Loading branch information
kschrief committed May 8, 2024
1 parent 90c9abc commit 99bdba0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions src/validate/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 99bdba0

Please sign in to comment.