test: address PR review feedback for blocked-task schema

This commit is contained in:
Abhimanyu Saharan
2026-03-04 22:46:40 +05:30
parent 8b77eae0f2
commit e9ce004e70
2 changed files with 12 additions and 1 deletions

View File

@@ -13,4 +13,15 @@ def test_openapi_blocked_task_error_includes_code_field() -> None:
# `code` is optional but must be documented for clients.
assert "code" in props
assert props["code"].get("anyOf")
required_fields = blocked_detail.get("required", [])
assert "code" not in required_fields
code_schema = props["code"]
any_of = code_schema.get("anyOf")
assert isinstance(any_of, list) and any_of
has_string_branch = any(branch.get("type") == "string" for branch in any_of)
assert has_string_branch
has_null_branch = any(branch.get("type") == "null" or branch.get("nullable") is True for branch in any_of)
assert has_null_branch