Skip to content

Commit 4b616c3

Browse files
authored
Ensure azure_core is proper superset of typespec (Azure#3043)
Missed a few things in the last release that didn't show up in tests/examples because we don't need to refer to them by name...which we couldn't have imported.
1 parent 748caee commit 4b616c3

File tree

9 files changed

+21
-14
lines changed

9 files changed

+21
-14
lines changed

sdk/core/azure_core/src/http/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub use pager::{ItemIterator, PageIterator, Pager};
1818
pub use pipeline::*;
1919
pub use poller::Poller;
2020
pub use request::{Body, Request, RequestContent};
21-
pub use response::{BufResponse, Response};
21+
pub use response::{BufResponse, RawResponse, Response};
2222

2323
pub use typespec_client_core::http::response;
2424
pub use typespec_client_core::http::{

sdk/typespec/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Changed `RawResponse::json()` from `async` to synchronous function. The body was already buffered.
1212
- Changed `RawResponse::xml()` from `async` to synchronous function. The body was already buffered.
1313
- Removed `ErrorKind::http_response()`. Construct an `ErrorResponse::HttpResponse` variant instead.
14+
- Moved `AsHeaders`, `FromHeaders`, `Header`, `Headers`, `HeaderName`, and `HeaderValue` to `http::headers` module to align with `typespec_client_core`.
1415
- Renamed a number of construction functions for `Error` to align with [guidelines](https://azure.github.io/azure-sdk/rust_introduction.html)"
1516
- Renamed `Error::full()` to `Error::with_error()`.
1617
- Renamed `Error::with_message()` to `Error::with_message_fn()`.
@@ -25,6 +26,9 @@
2526

2627
### Other Changes
2728

29+
- Made `http::headers` a public module to align with `typespec_client_core`.
30+
- Made `http::response` a public module to align with `typespec_client_core`.
31+
2832
## 0.8.0 (2025-09-11)
2933

3034
### Features Added

sdk/typespec/src/http/headers.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ pub static DEFAULT_ALLOWED_HEADER_NAMES: LazyLock<HashSet<Cow<'static, str>>> =
4646
.collect()
4747
});
4848

49-
/// Default pattern for redacted headers or query parameters.
50-
pub const REDACTED_PATTERN: &str = "REDACTED";
51-
5249
/// A trait for converting a type into request headers.
5350
pub trait AsHeaders {
5451
/// The error type which can occur when converting the type into headers.
@@ -282,7 +279,7 @@ impl fmt::Debug for Headers {
282279
if DEFAULT_ALLOWED_HEADER_NAMES.contains(k.as_str()) {
283280
v.as_str()
284281
} else {
285-
REDACTED_PATTERN
282+
super::REDACTED_PATTERN
286283
},
287284
)
288285
}))

sdk/typespec/src/http/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33

44
//! This module contains types and utilities for working with HTTP status codes.
55
6-
mod headers;
7-
mod response;
6+
pub mod headers;
7+
pub mod response;
88
mod status_code;
99

10-
pub use headers::*;
11-
pub use response::*;
10+
pub use headers::DEFAULT_ALLOWED_HEADER_NAMES;
11+
pub use response::RawResponse;
1212
pub use status_code::StatusCode;
13+
14+
/// Default pattern for redacted headers or query parameters.
15+
pub const REDACTED_PATTERN: &str = "REDACTED";

sdk/typespec/src/http/response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! HTTP responses.
55
66
use crate::{
7-
http::{Headers, StatusCode},
7+
http::{headers::Headers, StatusCode},
88
Bytes,
99
};
1010
#[cfg(any(feature = "json", feature = "xml"))]

sdk/typespec/typespec_client_core/src/http/headers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
mod common;
77

88
pub use common::*;
9-
pub use typespec::http::{AsHeaders, FromHeaders, Header, HeaderName, HeaderValue, Headers};
9+
pub use typespec::http::headers::*;

sdk/typespec/typespec_client_core/src/http/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ pub use models::*;
2424
pub use options::*;
2525
pub use pipeline::*;
2626
pub use request::{Body, Request, RequestContent};
27-
pub use response::{BufResponse, Response};
27+
pub use response::{BufResponse, RawResponse, Response};
2828
pub use sanitizer::*;
2929

3030
// Re-export important types.
31-
pub use typespec::http::{RawResponse, StatusCode};
31+
pub use typespec::http::StatusCode;
3232
pub use url::Url;
3333

3434
/// Add a new query pair into the target [`Url`]'s query string.

sdk/typespec/typespec_client_core/src/http/request/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ mod decimal {
340340
use std::convert::Infallible;
341341

342342
#[allow(
343+
unknown_lints,
343344
clippy::infallible_try_from,
344345
reason = "maintain a consistent pattern of `try_into()`"
345346
)]
@@ -354,6 +355,7 @@ mod decimal {
354355
}
355356

356357
#[allow(
358+
unknown_lints,
357359
clippy::infallible_try_from,
358360
reason = "maintain a consistent pattern of `try_into()`"
359361
)]

sdk/typespec/typespec_client_core/src/http/response.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
//! HTTP responses.
55
66
use crate::{
7-
http::{headers::Headers, DeserializeWith, Format, JsonFormat, RawResponse, StatusCode},
7+
http::{headers::Headers, DeserializeWith, Format, JsonFormat, StatusCode},
88
Bytes,
99
};
1010
use futures::{Stream, StreamExt};
1111
use serde::de::DeserializeOwned;
1212
use std::{fmt, marker::PhantomData, pin::Pin};
1313
use typespec::error::{ErrorKind, ResultExt};
14+
pub use typespec::http::response::*;
1415

1516
/// A pinned stream of bytes that can be sent as a response body.
1617
#[cfg(not(target_arch = "wasm32"))]

0 commit comments

Comments
 (0)