expose itempolicy to the wf_authoring

This commit is contained in:
lda
2026-05-23 21:42:37 +07:00 Verified
parent 1c5cf15815
commit e09d714c72
6 changed files with 361 additions and 4 deletions
+8
View File
@@ -171,6 +171,14 @@ class ForeachItemErrorPolicy(BaseModel):
action: Literal["fail", "skip", "collect"] = "fail"
collect_to: StatePath | None = None
@model_validator(mode="before")
@classmethod
def _coerce_action_string(cls, data: object) -> object:
"""Accept bare action strings for policies with no extra fields."""
if isinstance(data, str):
return {"action": data}
return data
@model_validator(mode="after")
def _validate_collect_to(self) -> Self:
if self.action == "collect" and self.collect_to is None: