fix: smooth draft schema projection ux

This commit is contained in:
lda
2026-06-29 18:55:22 +07:00 Verified
parent 664beec837
commit 5f520d74bd
15 changed files with 335 additions and 16 deletions
+20
View File
@@ -99,6 +99,26 @@ def test_project_output_property_rejects_existing_state_field() -> None:
)
def test_project_output_property_allows_equivalent_existing_state_field() -> None:
state_schema = {
"type": "object",
"properties": {"after": {"type": "object"}},
}
projected = project_output_property_to_state_schema(
state_schema=state_schema,
output_schema={
"type": "object",
"properties": {"after": {"type": "object"}},
},
output_field="after",
state_field="after",
allow_existing_equivalent=True,
)
assert projected == state_schema
def test_project_output_property_rejects_invalid_output_schema() -> None:
with pytest.raises(ValueError, match="output_schema is not valid JSON Schema"):
project_output_property_to_state_schema(