From 31d6566fee12d0f5c9384b2d8950a84d3fb81b9c Mon Sep 17 00:00:00 2001 From: John Batty Date: Wed, 17 Sep 2025 22:10:17 +0100 Subject: [PATCH 1/3] Change ServiceEndpoint description field to be optional --- CHANGELOG.md | 3 +++ azure_devops_rust_api/src/service_endpoint/models.rs | 6 +++--- vsts-api-patcher/src/patcher.rs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c49474d..ad1b40c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Change `ServiceEndpoint` field to be optional: + - `description` + ## [0.30.0] ### Changes diff --git a/azure_devops_rust_api/src/service_endpoint/models.rs b/azure_devops_rust_api/src/service_endpoint/models.rs index 02ea6e50..78877644 100644 --- a/azure_devops_rust_api/src/service_endpoint/models.rs +++ b/azure_devops_rust_api/src/service_endpoint/models.rs @@ -1312,7 +1312,8 @@ pub struct ServiceEndpoint { pub created_by: IdentityRef, pub data: serde_json::Value, #[doc = "Gets or sets the description of endpoint."] - pub description: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, #[doc = "This is a deprecated field."] #[serde( rename = "groupScopeId", @@ -1364,7 +1365,6 @@ impl ServiceEndpoint { authorization: EndpointAuthorization, created_by: IdentityRef, data: serde_json::Value, - description: String, id: String, is_ready: bool, is_shared: bool, @@ -1378,7 +1378,7 @@ impl ServiceEndpoint { authorization, created_by, data, - description, + description: None, group_scope_id: None, id, is_ready, diff --git a/vsts-api-patcher/src/patcher.rs b/vsts-api-patcher/src/patcher.rs index d10c2a31..05d725ad 100644 --- a/vsts-api-patcher/src/patcher.rs +++ b/vsts-api-patcher/src/patcher.rs @@ -1042,11 +1042,11 @@ impl Patcher { // Excluded // administratorsGroup // operationStatus + // description r#"[ "authorization", "createdBy", "data", - "description", "id", "isReady", "isShared", From f34df3a35e0a539b1dee98770f5a83a032fd8b1b Mon Sep 17 00:00:00 2001 From: John Batty Date: Wed, 17 Sep 2025 22:18:27 +0100 Subject: [PATCH 2/3] Update service_endpoint example --- azure_devops_rust_api/examples/service_endpoint.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure_devops_rust_api/examples/service_endpoint.rs b/azure_devops_rust_api/examples/service_endpoint.rs index 0427667e..a9f71d4f 100644 --- a/azure_devops_rust_api/examples/service_endpoint.rs +++ b/azure_devops_rust_api/examples/service_endpoint.rs @@ -32,8 +32,8 @@ async fn main() -> Result<()> { // Display the returned service endpoints for endpoint in service_endpoints.iter() { println!( - "{:38} {:40} {}", - endpoint.id, endpoint.name, endpoint.description + "{:38} {:40} {:?}", + endpoint.id, endpoint.name, endpoint.description.as_deref().unwrap_or("") ); } From 865f511a74c267a020854d7fec8270d09e993710 Mon Sep 17 00:00:00 2001 From: John Batty Date: Wed, 17 Sep 2025 22:21:35 +0100 Subject: [PATCH 3/3] cargo fmt --- azure_devops_rust_api/examples/service_endpoint.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure_devops_rust_api/examples/service_endpoint.rs b/azure_devops_rust_api/examples/service_endpoint.rs index a9f71d4f..190eec62 100644 --- a/azure_devops_rust_api/examples/service_endpoint.rs +++ b/azure_devops_rust_api/examples/service_endpoint.rs @@ -33,7 +33,9 @@ async fn main() -> Result<()> { for endpoint in service_endpoints.iter() { println!( "{:38} {:40} {:?}", - endpoint.id, endpoint.name, endpoint.description.as_deref().unwrap_or("") + endpoint.id, + endpoint.name, + endpoint.description.as_deref().unwrap_or("") ); }