Add JSON Schema validation of parsed JSON#265
Merged
Conversation
The framework only generated JSON Schema and data_quality is a flat per-column checker, so nested API request/response bodies could not be validated. Add a Draft 2020-12 subset validator that reports every violation with a readable path, wired through the facade, AC_validate_json executor command, ac_validate_json MCP tool and the Script Builder.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 143 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
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
The framework only ever generated JSON Schema (action-lint, tool-use schema), and
data_quality.validate_rowsis a flat, per-column table checker — neither could validate a nested API request/response body against a real schema. This adds the missing consumer: a pure-stdlib JSON Schema (Draft 2020-12 subset) validator.validate_json(instance, schema) -> SchemaValidationResult— collects every violation as{path, keyword, message}(e.g.$.age maximum,$.extra additionalProperties).is_valid(...)boolean shortcut;assert_schema(...)raisesAutoControlAssertionExceptionwith a joined summary.type(incl.integermatching integral floats but never bools),enum/const(keepsTrue/1distinct), numeric & string bounds, array keywords (items/prefixItems/contains/uniqueItems/size), object keywords (required/properties/patternProperties/additionalProperties/size), combinators (allOf/anyOf/oneOf/not), boolean schemas, and local$ref(#/$defs/...). Remote$refandformatare out of scope.Pure standard library (
re); imports noPySide6. Pairs with the existingjson_queryandhttp_requesthelpers.Five-layer wiring
je_auto_control/utils/json_schema/je_auto_control/__init__.py+__all__AC_validate_jsonac_validate_jsonTests & docs
test/unit_test/headless/test_json_schema_batch.py(16 tests, all green; full headless suite passes)Lint clean: ruff / pylint / bandit / radon (no function CC > 10).