Skip to content

feat(generator): emit all documented responses via Tuyau rawResponse#2

Open
thetutlage wants to merge 1 commit into
madebyoutloud:mainfrom
thetutlage:feat/emit-all-responses
Open

feat(generator): emit all documented responses via Tuyau rawResponse#2
thetutlage wants to merge 1 commit into
madebyoutloud:mainfrom
thetutlage:feat/emit-all-responses

Conversation

@thetutlage

@thetutlage thetutlage commented Jul 8, 2026

Copy link
Copy Markdown

getResponses() previously read only the response type and hardcoded it under status 200. As a result error responses (401/403/422/…) were never emitted, non-200 successes (201) were mislabeled 200, and empty-body 204s were dropped entirely.

Drive responses from Tuyau's normalized rawResponse union ({ status; response } across all status codes): split the union, read each member's instantiated status literal and body, group by status, and emit one response per code (oneOf when a code has multiple shapes; no content for empty 204 bodies). Falls back to the legacy response→200 path when rawResponse is absent, so older @tuyau/core registries keep working.

Status/response literals are read via getTypeAtLocation so the instantiated value (201 / concrete body) is used rather than the generic ExtractRawResponse type parameters.

getResponses() previously read only the `response` type and hardcoded it
under status 200. As a result error responses (401/403/422/…) were never
emitted, non-200 successes (201) were mislabeled 200, and empty-body 204s
were dropped entirely.

Drive responses from Tuyau's normalized `rawResponse` union
({ status; response } across all status codes): split the union, read each
member's instantiated status literal and body, group by status, and emit one
response per code (oneOf when a code has multiple shapes; no content for
empty 204 bodies). Falls back to the legacy `response`→200 path when
`rawResponse` is absent, so older @tuyau/core registries keep working.

Status/response literals are read via getTypeAtLocation so the instantiated
value (201 / concrete body) is used rather than the generic ExtractRawResponse
type parameters.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P3ZYnmGMEZwTuBuZviLDSq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant