From 1e4c20a94d1e7ac6d7057d199bf3e3a77a3d70df Mon Sep 17 00:00:00 2001 From: Chad Baker Date: Wed, 18 Dec 2024 10:43:27 -0700 Subject: [PATCH] added `skip_serializing_if` for HashMap --- rust/altrios-core/src/track/link/link_impl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/altrios-core/src/track/link/link_impl.rs b/rust/altrios-core/src/track/link/link_impl.rs index 9ffed982..11a2f75f 100644 --- a/rust/altrios-core/src/track/link/link_impl.rs +++ b/rust/altrios-core/src/track/link/link_impl.rs @@ -39,7 +39,7 @@ pub struct Link { /// Spatial vector of compass heading values and corresponding positions along track pub headings: Vec, /// Map of train types and corresponding speed sets - #[serde(default)] + #[serde(default, skip_serializing_if = "HashMap::is_empty")] pub speed_sets: HashMap, /// Optional train-type-neutral [SpeedSet]. If provided, overrides [Link::speed_sets]. pub speed_set: Option,