Problem
Callers sometimes need headers/status without paying for deserialization.
Proposed change
Generate each operation in two tiers — a cooked method returning the parsed body, and a raw method returning a lazy ParsedResponse<T> whose parse() consumes/closes the body. Compose error-mapping + deserialization as Response -> X handlers at the generated-service layer (not as HTTP-pipeline stages — the pipeline stays transport-pure and keeps returning a raw Response). Rely on Closeable + use {} + KDoc; don't pull in a @MustBeClosed lint annotation.
Prior art: openai-java's withRawResponse() services (ModelServiceImpl.kt).
Acceptance
Builds on the ResponseHandler seam.
Dependencies
Priority: high · Effort: medium
Problem
Callers sometimes need headers/status without paying for deserialization.
Proposed change
Generate each operation in two tiers — a cooked method returning the parsed body, and a raw method returning a lazy
ParsedResponse<T>whoseparse()consumes/closes the body. Compose error-mapping + deserialization asResponse -> Xhandlers at the generated-service layer (not as HTTP-pipeline stages — the pipeline stays transport-pure and keeps returning a rawResponse). Rely onCloseable+use {}+ KDoc; don't pull in a@MustBeClosedlint annotation.Prior art: openai-java's
withRawResponse()services (ModelServiceImpl.kt).Acceptance
Builds on the ResponseHandler seam.
Dependencies
Priority: high · Effort: medium