Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions preprocess_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ def eval_prop_inclusion(name, data, op, base_required):
is_required = False
elif isinstance(marker, dict):
val = marker.get(op)
if isinstance(val, dict):
# Handle transition-shaped marker: {"transition": {"from": "...", "to": "..."}}
transition = val.get("transition", {})
val = transition.get("to")
if val == "omit" or val is None:
include = False
elif val == "required":
Expand Down
13 changes: 13 additions & 0 deletions tests/test_codegen_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@ def test_eval_prop_inclusion_applies_operation_overrides(self) -> None:
["field"],
(False, True),
),
(
"transition-omit",
{
"ucp_request": {
"update": {
"transition": {"from": "required", "to": "omit"}
}
}
},
"update",
["field"],
(False, True),
),
(
"undeclared-operation",
{"ucp_request": {"update": "required"}},
Expand Down
Loading