diff --git a/preprocess_schemas.py b/preprocess_schemas.py index 14d0464..a4fe2e9 100644 --- a/preprocess_schemas.py +++ b/preprocess_schemas.py @@ -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": diff --git a/tests/test_codegen_pipeline.py b/tests/test_codegen_pipeline.py index 955502b..fe4d863 100644 --- a/tests/test_codegen_pipeline.py +++ b/tests/test_codegen_pipeline.py @@ -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"}},