Skip to content

WIP: Support custom serialization for RequestContent #2843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"rustup",
"seekable",
"servicebus",
"spector",
"stylesheet",
"subclient",
"telemetered",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl BlockBlobClient {
/// * `options` - Optional configuration for the request.
pub async fn commit_block_list(
&self,
blocks: RequestContent<BlockLookupList>,
blocks: RequestContent<BlockLookupList, XmlFormat>,
options: Option<BlockBlobClientCommitBlockListOptions<'_>>,
) -> Result<Response<BlockBlobClientCommitBlockListResult, NoFormat>> {
self.client.commit_block_list(blocks, options).await
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions sdk/storage/azure_storage_blob/tests/block_blob_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ async fn test_block_list(ctx: TestContext) -> Result<(), Box<dyn Error>> {
uncommitted: Some(Vec::new()),
};

let request_content = RequestContent::try_from(block_lookup_list)?;

block_blob_client
.commit_block_list(request_content, None)
.commit_block_list(block_lookup_list.try_into()?, None)
.await?;

// Three Committed Blocks Scenario
Expand Down
2 changes: 1 addition & 1 deletion sdk/typespec/typespec_client_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rand.workspace = true
reqwest = { workspace = true, optional = true }
rust_decimal = { workspace = true, optional = true }
serde.workspace = true
serde_json.workspace = true
serde_json = { workspace = true, features = ["raw_value"] }
time.workspace = true
tokio = { workspace = true, optional = true }
tracing.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions sdk/typespec/typespec_client_core/src/fs/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ impl From<FileStream> for Body {
}

#[cfg(not(target_arch = "wasm32"))]
impl<T> From<&FileStream> for RequestContent<T> {
impl<T, F> From<&FileStream> for RequestContent<T, F> {
fn from(stream: &FileStream) -> Self {
Body::from(stream).into()
}
}

#[cfg(not(target_arch = "wasm32"))]
impl<T> From<FileStream> for RequestContent<T> {
impl<T, F> From<FileStream> for RequestContent<T, F> {
fn from(stream: FileStream) -> Self {
Body::from(stream).into()
}
Expand Down
Loading
Loading