Skip to content

Conversation

heaths
Copy link
Member

@heaths heaths commented Sep 9, 2025

Renames RawResponse to BufResponse - inspired by std::io::BufReader, and adds a new RawResponse where the body is fully read and stored in Bytes.
Refactored Headers and other types necessary to add RawResponse to ErrorKind::HttpResponse.

Fixes #2962
Fixes #2495
Relates to #2725
Relates to #1995

Renames `RawResponse` to `BufResponse` - inspired by `std::io::BufReader`, and adds a new `RawResponse` where the body is fully read and stored in `Bytes`.
Refactored `Headers` and other types necessary to add `RawResponse` to `ErrorKind::HttpResponse`.

Fixes Azure#2962
Fixes Azure#2495
Relates to Azure#2725
Relates to Azure#1995
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames RawResponse to BufResponse and introduces a new RawResponse type that stores the complete response body as Bytes. The new RawResponse is added to ErrorKind::HttpResponse to provide better error context. Additionally, it refactors Headers and other HTTP-related types to support this change.

  • Renamed RawResponse to BufResponse throughout the codebase to reflect its streaming nature
  • Added new RawResponse that contains the complete response body as Bytes
  • Enhanced ErrorKind::HttpResponse to include the new RawResponse for better error diagnostics

Reviewed Changes

Copilot reviewed 63 out of 70 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/typespec/src/error/mod.rs Added raw_response field to ErrorKind::HttpResponse and updated constructors
sdk/typespec/src/http/response.rs Added new RawResponse struct with complete body as Bytes
sdk/typespec/typespec_client_core/src/http/response.rs Renamed RawResponse to BufResponse and added conversion method
sdk/typespec/typespec_client_core/src/http/headers/mod.rs Moved header types to typespec crate
Multiple client files Updated imports and type references from RawResponse to BufResponse

@github-actions github-actions bot added Azure.Core The azure_core crate Azure.Identity The azure_identity crate Cosmos The azure_cosmos crate KeyVault Key Vault Storage Storage Service (Queues, Blobs, Files) labels Sep 9, 2025
@heaths heaths enabled auto-merge (squash) September 10, 2025 00:34
@LarryOsterman LarryOsterman merged commit 96e92ce into Azure:main Sep 10, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Azure SDK for Key Vault Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core The azure_core crate Azure.Identity The azure_identity crate Cosmos The azure_cosmos crate KeyVault Key Vault Storage Storage Service (Queues, Blobs, Files)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Refactor error types for generic and Azure-specific models Attach raw stream to ErrorKind::HttpResponse
2 participants