From fa1ba2cc01477f6b69b3dd422e575e2f887eaf8b Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Tue, 7 Jul 2026 07:58:58 -0700 Subject: [PATCH] fix(api): type initial_message_status as a Literal enum str | None under-specified the field: the implementation and the TS SDK union both constrain it to queue_full / refused_closed, and the Literal projects a proper enum into the generated OpenAPI spec so clients reject unexpected values. Specs regenerated. --- sdk/typescript/openapi-server.json | 4 ++++ turnstone/api/server_schemas.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/typescript/openapi-server.json b/sdk/typescript/openapi-server.json index 03d7270d..c124c02d 100644 --- a/sdk/typescript/openapi-server.json +++ b/sdk/typescript/openapi-server.json @@ -2568,6 +2568,10 @@ "initial_message_status": { "anyOf": [ { + "enum": [ + "queue_full", + "refused_closed" + ], "type": "string" }, { diff --git a/turnstone/api/server_schemas.py b/turnstone/api/server_schemas.py index b81a98ae..64ad9eb4 100644 --- a/turnstone/api/server_schemas.py +++ b/turnstone/api/server_schemas.py @@ -224,7 +224,7 @@ class CreateWorkstreamResponse(BaseModel): "/v1/api/workstreams/{ws_id}/send." ), ) - initial_message_status: str | None = Field( + initial_message_status: Literal["queue_full", "refused_closed"] | None = Field( default=None, description=( "Present ONLY when the workstream was created but its "