fix: validate workflow output target references

This commit is contained in:
lda
2026-07-26 21:46:42 +07:00 Verified
parent 0f11773611
commit b3ac92d8cb
5 changed files with 39 additions and 20 deletions
+21
View File
@@ -481,6 +481,27 @@ def test_schema_path_exists_follows_local_defs() -> None:
assert schema_path_exists(schema, ("report", "missing")) is False
def test_project_schema_path_rejects_unresolved_equivalent_target_reference() -> None:
with pytest.raises(
ValueError,
match=r"unresolved reference '#/\$defs/Report'",
):
project_schema_path_to_schema_path(
target_schema={
"type": "object",
"properties": {"report": {"$ref": "#/$defs/Report"}},
},
source_schema={
"type": "object",
"properties": {"report": {"$ref": "#/$defs/Report"}},
"$defs": {"Report": {"type": "object", "properties": {}}},
},
source_parts=("report",),
target_parts=("report",),
allow_existing_equivalent=True,
)
def test_project_schema_path_rejects_missing_nested_source() -> None:
with pytest.raises(
ValueError,