chore(api): name MessageDto as a component in the OpenAPI spec #365

Closed
opened 2026-06-29 13:19:27 +00:00 by james · 0 comments
Owner

MessageDto is used by ConversationDetailDto.messages[] and TurnResponseDto.messages[] but is inlined in the generated OpenAPI types rather than registered as a named components.schemas.MessageDto (its zod schema never gets .openapi("MessageDto")).

Consequence: downstream consumers can't reference components["schemas"]["MessageDto"] directly and instead derive it from TurnResponseDto["messages"][number] — see packages/api-client/src/agent-stream.ts (#344) and the activity/chat code.

Scope

  • Register zMessageDto as a named component (.openapi("MessageDto")) in apps/api/lib/api/openapi-routes.ts so it appears under components.schemas.
  • Regenerate openapi.json + the @carol/api-client types (both drift gates).
  • Optionally simplify the TurnResponseDto["messages"][number] derivations to the now-named MessageDto.

Small, low-risk cleanup. Part of epic #47.

`MessageDto` is used by `ConversationDetailDto.messages[]` and `TurnResponseDto.messages[]` but is **inlined** in the generated OpenAPI types rather than registered as a named `components.schemas.MessageDto` (its zod schema never gets `.openapi("MessageDto")`). Consequence: downstream consumers can't reference `components["schemas"]["MessageDto"]` directly and instead derive it from `TurnResponseDto["messages"][number]` — see `packages/api-client/src/agent-stream.ts` (#344) and the activity/chat code. ## Scope - Register `zMessageDto` as a named component (`.openapi("MessageDto")`) in `apps/api/lib/api/openapi-routes.ts` so it appears under `components.schemas`. - Regenerate `openapi.json` + the `@carol/api-client` types (both drift gates). - Optionally simplify the `TurnResponseDto["messages"][number]` derivations to the now-named `MessageDto`. Small, low-risk cleanup. Part of epic #47.
james closed this issue 2026-06-29 13:53:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#365
No description provided.