Summary
While shipping v2.5.0, two pre-existing validation failures were confirmed in the repo's example artifacts. Neither is a regression — both reproduce on main before the v2.5.0 changes — but they mean the committed examples don't pass the tool's own validate command, and they forced a workaround in the new test suite.
1. tests/gen3_schema/examples/yaml/project.yaml — consent_codes array has no items
RuleValidator.type_array_needs_items rejects the fixture:
ValueError: Schema 'project' property 'consent_codes' with type 'array' must include an 'items' property.
The fixture (lines ~123-128) declares consent_codes as type: array with only a description. The shipped template src/gen3schemadev/schema/schema_templates/project.yaml has the correct shape for the same property (items with type: string, the DUO enum, and enumDef).
Fix: copy the items block from the template's consent_codes into the fixture (or regenerate the fixture from the current template).
2. tests/input_example.yml — project node missing a required code property
RuleValidator.project_must_require_code rejects any dictionary generated from the example input:
ValueError: Schema 'project' must include 'code' in the 'required' list.
The example input's user-defined project node only declares project_id and description, so the generated project.yaml never gets code in required. Gen3 uses code as the unique project identifier, so the example teaches users an input model that fails the tool's own validation:
poetry run gen3schemadev generate -i tests/input_example.yml -o output
poetry run gen3schemadev validate -y output # fails on project_must_require_code
Fix: add a code property with required: true to the project node in tests/input_example.yml (and check tests/input_example_fail.yml / tests/input_example_file_props.yml for the same gap where a project node is defined). Update any converter test expectations that assert on the project node's properties (e.g. test_construct_prop_project in tests/test_converter.py).
Cleanup once fixed
(Obsolete: tests/test_fix_refs_pipeline.py was removed in v2.6.1 when the allOf wrapping feature was reverted.) No test currently exercises full validation of the example fixtures; once the fixtures are repaired, consider adding one so every non-excluded example schema must pass RuleValidator outright.
Acceptance criteria
poetry run gen3schemadev validate -y passes on a dictionary generated from tests/input_example.yml.
RuleValidator passes on every non-excluded schema in tests/gen3_schema/examples/yaml/.
poetry run pytest -vv tests/ stays green.
Summary
While shipping v2.5.0, two pre-existing validation failures were confirmed in the repo's example artifacts. Neither is a regression — both reproduce on
mainbefore the v2.5.0 changes — but they mean the committed examples don't pass the tool's ownvalidatecommand, and they forced a workaround in the new test suite.1.
tests/gen3_schema/examples/yaml/project.yaml—consent_codesarray has noitemsRuleValidator.type_array_needs_itemsrejects the fixture:The fixture (lines ~123-128) declares
consent_codesastype: arraywith only adescription. The shipped templatesrc/gen3schemadev/schema/schema_templates/project.yamlhas the correct shape for the same property (itemswithtype: string, the DUOenum, andenumDef).Fix: copy the
itemsblock from the template'sconsent_codesinto the fixture (or regenerate the fixture from the current template).2.
tests/input_example.yml— project node missing a requiredcodepropertyRuleValidator.project_must_require_coderejects any dictionary generated from the example input:The example input's user-defined
projectnode only declaresproject_idanddescription, so the generatedproject.yamlnever getscodeinrequired. Gen3 usescodeas the unique project identifier, so the example teaches users an input model that fails the tool's own validation:poetry run gen3schemadev generate -i tests/input_example.yml -o output poetry run gen3schemadev validate -y output # fails on project_must_require_codeFix: add a
codeproperty withrequired: trueto theprojectnode intests/input_example.yml(and checktests/input_example_fail.yml/tests/input_example_file_props.ymlfor the same gap where a project node is defined). Update any converter test expectations that assert on the project node's properties (e.g.test_construct_prop_projectintests/test_converter.py).Cleanup once fixed
(Obsolete:No test currently exercises full validation of the example fixtures; once the fixtures are repaired, consider adding one so every non-excluded example schema must passtests/test_fix_refs_pipeline.pywas removed in v2.6.1 when the allOf wrapping feature was reverted.)RuleValidatoroutright.Acceptance criteria
poetry run gen3schemadev validate -ypasses on a dictionary generated fromtests/input_example.yml.RuleValidatorpasses on every non-excluded schema intests/gen3_schema/examples/yaml/.poetry run pytest -vv tests/stays green.