58 validator should check for params with nested values#62
Merged
abrown-RV merged 11 commits intoJul 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the existing validator to use a modular “checks” registry (getChecks / runChecks), adds a nested-values warning check for device descriptors, and updates the validator output formatting to distinguish errors vs warnings.
Changes:
- Replaced the ad-hoc mandatory validation call with a generic check registry and per-check disable flags.
- Added a new nested-values check that emits warnings (non-fatal) for unreferenced nested values and for top-level non-template params without values.
- Updated test suite + coverage collection, and adjusted
examples/validate.shto be runnable from any working directory.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/validator.js | Integrates checks.runChecks and prefixes output with ERROR: / WARNING:. |
| tools/tests/validator.test.js | Updates validator tests to mock runChecks and to assert new log prefixes. |
| tools/jest.config.cjs | Switches coverage collection from mandatory.js to checks/*.js. |
| tools/checks/nested-values.js | Implements the new nested-values warning check. |
| tools/checks/nested-values.test.js | Adds unit tests for nested-values warning behavior and disable flag. |
| tools/checks/mandatory.js | Refactors mandatory validation into the checks framework (opts + disable flag). |
| tools/checks/mandatory.test.js | Updates mandatory check tests to pass opts and adds additional cases. |
| tools/checks/index.js | Introduces the check registry and exports WARNING/ERROR constants. |
| tools/checks/index.test.js | Adds tests locking in the check registry contents and aggregation behavior. |
| tools/checks/constants.js | Defines WARNING / ERROR constants shared by checks and validator. |
| examples/validate.sh | Ensures schema build + validation works regardless of where the script is invoked from. |
Comments suppressed due to low confidence (2)
tools/checks/mandatory.js:119
- The value-validation errors use instancePaths like
/params/product/params/<key>/value, but the actual values live under/params/product/value/struct_value/fields/<key>/string_value(seeexamples/device.example.yaml). This makes the reported path misleading and preventssourceMap.pointers[instancePath]from resolving line numbers.
tools/checks/mandatory.test.js:2 - The copyright header uses a Roman numeral year that doesn’t match the numeric year (MMXXV is 2025, but the line says 2026). Other repo files keep these in sync (e.g.,
interface/schemata/client-hints.yamluses “MMXXV 2025”).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NR-RV
approved these changes
Jul 7, 2026
abrown-RV
deleted the
58-validator-should-check-for-params-with-nested-values
branch
July 7, 2026 19:33
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.
refactored the ad-hoc mandatory checks out of the validator into a
checks/directory with a generic registry (getChecks/runChecks). each check is its own module with its own disable flag.added a new check that warns about:
template_oidwarnings don't fail validation, only errors do.
showErrorsnow prefixes output withERROR:orWARNING:accordingly.also fixed
validate.shso it runs from anywhere, and added copyright headers to test files.