Add configuration schema validator and CI checks#1667
Merged
Conversation
Add a new schema validation script (scripts/validate-configuration-schemas.mjs) that finds packages/*/*configuration-schema.json and validates them against JSON Schema draft-07 using Ajv. The script prints human-friendly errors (or a markdown table with --markdown) and exits non-zero on failures. Wire this check into CI: run pnpm validate:schemas in .github workflows (ci, docs, publish). Update package.json to add the validate:schemas script and Ajv dependency, and update README, templates, and the wiki to document JSON Schema draft-07 and instruct maintainers to run pnpm validate:schemas after editing configuration-schema.json.
Contributor
Author
|
@elias-ba @josephjclark when you have a moment, could you review this PR? |
Collaborator
|
Hi @aloundoye , thanks for raising this! What's the goal of this? Just to ensure that schemas are structurally valid? |
Contributor
Author
|
Hi @josephjclark. Yes, the immediate goal is to ensure the schemas are structurally valid JSON Schema before they ship. |
Contributor
|
@aloundoye Thank you for taking the time to raise this PR. I tested it locally and its working great. Approving this cc @josephjclark |
hunterachieng
approved these changes
May 19, 2026
Collaborator
|
Thank you @aloundoye! |
josephjclark
added a commit
that referenced
this pull request
May 20, 2026
* Add configuration schema validator and CI checks (#1667) Add a new schema validation script (scripts/validate-configuration-schemas.mjs) that finds packages/*/*configuration-schema.json and validates them against JSON Schema draft-07 using Ajv. The script prints human-friendly errors (or a markdown table with --markdown) and exits non-zero on failures. Wire this check into CI: run pnpm validate:schemas in .github workflows (ci, docs, publish). Update package.json to add the validate:schemas script and Ajv dependency, and update README, templates, and the wiki to document JSON Schema draft-07 and instruct maintainers to run pnpm validate:schemas after editing configuration-schema.json. * don't validate schemas while publishing docs docs workflow depends on publish workflow, and publish has already validated --------- Co-authored-by: Alassane Ndoye <aloutndoye.an@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new schema validation script (scripts/validate-configuration-schemas.mjs) that finds packages/*/*configuration-schema.json and validates them against JSON Schema draft-07 using Ajv. The script prints human-friendly errors (or a markdown table with --markdown) and exits non-zero on failures. Wire this check into CI: run pnpm validate:schemas in .github workflows (ci, docs, publish). Update package.json to add the validate:schemas script and Ajv dependency, and update README, templates, and the wiki to document JSON Schema draft-07 and instruct maintainers to run pnpm validate:schemas after editing configuration-schema.json.
Fixes #1661
Details
Added a repo-level
validate:schemascommand that validates everypackages/*/*configuration-schema.jsonfile against the JSON Schema draft-07 meta-schema using Ajv. This includes standard adaptorconfiguration-schema.jsonfiles and Salesforce’soauth-configuration-schema.json.The validator prints CI-friendly failures with adaptor name, file path, JSON pointer, and reason, and supports
--markdownfor the one-shot audit table requested in issue #1661. It runs withstrict: falseso existing UI annotation keywords are allowed while still enforcing the JSON Schema spec.Wired
pnpm validate:schemasinto PR CI, publish, and docs workflows so malformed configuration schemas are caught before release. Also updated contributor docs and generator README templates to tell adaptor authors to validate schema changes and reference JSON Schema draft-07.This prevents invalid credential/configuration schemas from shipping and surfacing later as Lightning credential form runtime issues.
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to
know!):
You can read more details in our
Responsible AI Policy
Review Checklist
Before merging, the reviewer should check the following items:
production? Is it safe to release?
dev only changes don't need a changeset.