From 6e69db0a3cbef4d7a4c6da931f0d8a7d21e4d552 Mon Sep 17 00:00:00 2001 From: oufanz <18280587072@163.com> Date: Tue, 11 Aug 2026 16:49:46 +0800 Subject: [PATCH 1/2] fix: handle transition-shaped ucp_request markers in eval_prop_inclusion --- preprocess_schemas.py | 4 ++++ tests/test_codegen_pipeline.py | 11 +++++++++++ 2 files changed, 15 insertions(+) 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..d4a2240 100644 --- a/tests/test_codegen_pipeline.py +++ b/tests/test_codegen_pipeline.py @@ -227,6 +227,17 @@ 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"}}, From 6b22c80bdf180ffb804371936e8ad943a7ebbddc Mon Sep 17 00:00:00 2001 From: damaz91 Date: Tue, 11 Aug 2026 10:16:07 +0000 Subject: [PATCH 2/2] style: format code with ruff --- tests/test_codegen_pipeline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_codegen_pipeline.py b/tests/test_codegen_pipeline.py index d4a2240..fe4d863 100644 --- a/tests/test_codegen_pipeline.py +++ b/tests/test_codegen_pipeline.py @@ -231,7 +231,9 @@ def test_eval_prop_inclusion_applies_operation_overrides(self) -> None: "transition-omit", { "ucp_request": { - "update": {"transition": {"from": "required", "to": "omit"}} + "update": { + "transition": {"from": "required", "to": "omit"} + } } }, "update",