Skip to content
Closed
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
83 changes: 47 additions & 36 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ futures = "0.3"
getrandom = { version = "0.3" }
gloo-timers = { version = "0.3" }
hmac = { version = "0.12" }
include-file = { version = "0.4.0" }
litemap = "0.7.4"
openssl = { version = "0.10.72" }
opentelemetry = { version = "0.30", features = ["trace"] }
Expand Down
1 change: 1 addition & 0 deletions sdk/core/azure_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ azure_security_keyvault_certificates.path = "../../keyvault/azure_security_keyva
azure_security_keyvault_secrets.path = "../../keyvault/azure_security_keyvault_secrets"
criterion.workspace = true
http = "1.3.1"
include-file.workspace = true
json-patch = "4.1.0"
reqwest.workspace = true
thiserror.workspace = true
Expand Down
21 changes: 21 additions & 0 deletions sdk/core/azure_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,27 @@ let client = SecretClient::new(

See the [example](https://github.com/Azure/azure-sdk-for-rust/blob/main/sdk/core/azure_core/examples/core_remove_user_agent.rs) for a full sample implementation.

### JSON Merge Patch

Azure SDK for Rust does not explicitly support [JSON merge patch](https://www.rfc-editor.org/rfc/rfc7386), but it does allow you to update the payload accordingly and send it back to the service.

```rust ignore json_merge_patch
let mut resource: azure_core::Value = client.get_resource("foo", None).await?.body().json()?;

// Change the description and update tags.
resource["description"] = "an updated foo".into();
if let Some(tags) = resource["tags"].as_object_mut() {
tags["test"] = true.into();
tags.insert("version".into(), 1.into());
}

// Update the resource and assert expected properties.
let resource = client
.update_resource("foo", resource.try_into()?, None)
.await?
.into_model()?;
```

### Replacing the HTTP client

Though `azure_core` uses [`reqwest`] for its default HTTP client, you can replace it with either a customized `reqwest::Client` or an entirely different HTTP client.
Expand Down
Loading