Skip to content

Install referenced schema in "npm:validate" task #120

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

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Mar 12, 2025

The "npm:validate" task validates the repository's package.json npm manifest file against its JSON schema to catch any problems with its data format.

In order to avoid duplication of content, JSON schemas may reference other schemas via the $ref keyword. The package.json schema was recently updated to share resources with several other schemas, which caused the validation to start failing:

schema /tmp/package-json-schema-3RnDtCIiPG.json is invalid error: can't resolve reference https://json.schemastore.org/partial-eslint-plugins.json from id https://json.schemastore.org/eslintrc.json#

The solution is to configure the task to download the referenced schemas and provide their paths to the avj-cli validator via -r flags.

The "npm:validate" task validates the repository's `package.json` npm manifest file against its JSON schema to catch any
problems with its data format.

In order to avoid duplication of content, JSON schemas may reference other schemas via the `$ref` keyword. The
`package.json` schema was recently updated to share resources with several other schemas, which caused the validation to
start failing:

schema /tmp/package-json-schema-3RnDtCIiPG.json is invalid
error: can't resolve reference https://json.schemastore.org/partial-eslint-plugins.json from id https://json.schemastore.org/eslintrc.json#

The solution is to configure the task to download the referenced schemas and provide their paths to the avj-cli
validator via `-r` flags.
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: infrastructure Related to project infrastructure labels Mar 12, 2025
@per1234 per1234 self-assigned this Mar 12, 2025
@per1234 per1234 merged commit 7a7c54b into arduino:master Mar 12, 2025
24 checks passed
@per1234 per1234 deleted the update-check-schema branch March 12, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant