feat(generator): emit all documented responses via Tuyau rawResponse#2
Open
thetutlage wants to merge 1 commit into
Open
feat(generator): emit all documented responses via Tuyau rawResponse#2thetutlage wants to merge 1 commit into
thetutlage wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getResponses() previously read only the
responsetype 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
rawResponseunion ({ 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 legacyresponse→200 path whenrawResponseis 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.