You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validator crashes instead of reporting errors for invalid YAML structures #270
validation/validate.py can raise AttributeError after JSON Schema has already identified an invalid YAML shape. The exception prevents the existing validation reporter from showing the useful schema errors it collected.
This occurs when the document root is empty or not a mapping. It can also occur when semantic_model has an invalid nested shape because the semantic checks assume schema-valid mappings and lists.
Reproduction
From the repository root at 8c410f904c9bb20f683ef31292442e7bc432a8f6:
uv run validation/validate.py /dev/null --schema core-spec/osi-schema.json
The command exits with an internal exception:
AttributeError: 'NoneType' object has no attribute 'get'
Other affected inputs include a sequence root ([]), a scalar root, and a malformed nested value such as semantic_model: invalid.
Expected behavior
The command should exit 1 through the existing validation reporter:
Validation FAILED with 1 error(s):
[Schema] (root): None is not of type 'object'
It should not emit an internal traceback.
Proposed scope
Report the schema errors already collected for structurally invalid documents.
Run semantic checks only after schema validation has established their expected nested shapes.
Add focused regression coverage for empty, sequence, scalar, and malformed nested inputs.
Keep the specification, public CLI, and dependency set unchanged.
changed the title [-]Validator crashes on empty or non-mapping YAML roots[/-][+]Validator crashes instead of reporting errors for invalid YAML structures[/+]on Jul 26, 2026
Re-tested on current main (642cb89): this looks resolved, so noting the evidence for triage.
All four inputs the issue names now exit 1 through the reporter, with no traceback:
empty.yaml -> [Schema] (root): None is not of type 'object' exit 1
sequence root -> [Schema] (root): [] is not of type 'object' exit 1
scalar root -> [Schema] (root): 'just a scalar' is not of type 'object' exit 1
The issue's own reproduction command behaves as it asked it should:
$ python validation/validate.py /dev/null --schema core-spec/ossie-schema.json
Validation FAILED with 1 error(s):
[Schema] (root): None is not of type 'object'
(the schema file has since been renamed from osi-schema.json)
Run semantic checks only after schema validation has established their expected nested shapes — already the case: in main() the unique-name, reference, arity and SQL checks sit behind if not errors and isinstance(data, dict) and 'datasets' in data, and the ontology checks behind 'ontology' in data.
Focused regression coverage for empty, sequence, scalar and malformed nested inputs — validation/tests (181 tests) and validation/test_validate.py (53 tests) both pass on main.
Not my call to close it — reporting only that the reproduction no longer fails, in case this is stale.
Activity
[-]Validator crashes on empty or non-mapping YAML roots[/-][+]Validator crashes instead of reporting errors for invalid YAML structures[/+]ihadoop commentedon Oct 10, 2026
Re-tested on current
main(642cb89): this looks resolved, so noting the evidence for triage.All four inputs the issue names now exit 1 through the reporter, with no traceback:
The issue's own reproduction command behaves as it asked it should:
(the schema file has since been renamed from
osi-schema.json)Against the proposed scope:
AttributeErrorescape routes were closed by fix(validation): report unreadable input or schema, not a traceback #534 (unreadable input or schema) and fix(validation): reject a schema file that is valid JSON but not a schema #542 (a schema file that is valid JSON but not a schema).main()the unique-name, reference, arity and SQL checks sit behindif not errors and isinstance(data, dict) and 'datasets' in data, and the ontology checks behind'ontology' in data.validation/tests(181 tests) andvalidation/test_validate.py(53 tests) both pass onmain.Not my call to close it — reporting only that the reproduction no longer fails, in case this is stale.