deps: add ata JSON Schema validator for node.config.json#62603
Draft
mertcanaltin wants to merge 5 commits intonodejs:mainfrom
Draft
deps: add ata JSON Schema validator for node.config.json#62603mertcanaltin wants to merge 5 commits intonodejs:mainfrom
mertcanaltin wants to merge 5 commits intonodejs:mainfrom
Conversation
Add ata-validator (v0.4.3) as a new dependency for JSON Schema validation. Built with ATA_NO_RE2 to avoid RE2/abseil dependencies. Uses simdjson (already in core) for JSON parsing. Refs: nodejs#62598
Validate the configuration file against its JSON Schema using ata-validator as a supplementary check after the existing parser. This provides a safety net for type errors the parser might miss. Refs: nodejs#62598
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62603 +/- ##
==========================================
- Coverage 91.53% 89.70% -1.83%
==========================================
Files 352 695 +343
Lines 147833 214544 +66711
Branches 23148 41083 +17935
==========================================
+ Hits 135321 192466 +57145
- Misses 12255 14122 +1867
- Partials 257 7956 +7699
🚀 New features to boost your workflow:
|
Member
|
IMHO this is a bit too much, an extra dep for a schema parser inside Node.js (not to mention that is not even v1.x) This is not a blocker, this is just my personal opinion |
Member
Author
|
That's a fair concern. The dependency is intentionally minimal, it only uses simdjson which is already in core (no new external dependencies since it's built with ATA_NO_RE2). On the version, you're right it's pre-1.0, but it already passes 96.9% of the official JSON Schema Test Suite. Happy to work toward 1.0 if that's a requirement. |
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.
Adds https://github.com/ata-core/ata-validator (v0.4.3) to validate node.config.json against its JSON Schema before parsing.
This gives users clear error messages when their config file has invalid values or unknown properties, instead of the current generic "Invalid value" errors.
Example output for invalid config:
Invalid configuration in node.config.json: /nodeOptions/import: expected exactly one oneOf match, got 0
What's included:
refs: #62598