Document blocked-task 409 error code in OpenAPI + add regression tests

This commit is contained in:
Abhimanyu Saharan
2026-02-14 18:56:38 +00:00
committed by Abhimanyu Saharan
parent 2ae1c219f7
commit 8b77eae0f2
3 changed files with 129 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# ruff: noqa: INP001, S101
from __future__ import annotations
from app.main import app
def test_openapi_blocked_task_error_includes_code_field() -> None:
schema = app.openapi()
blocked_detail = schema["components"]["schemas"]["BlockedTaskDetail"]
props = blocked_detail.get("properties", {})
# `code` is optional but must be documented for clients.
assert "code" in props
assert props["code"].get("anyOf")