Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Account for new OpenRPC spec URL contents #186

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading