From 74a1e639e350e4b3eb2de350344bcfe08147ea8a Mon Sep 17 00:00:00 2001 From: Konstantin Burkalev Date: Tue, 3 Jun 2025 13:02:50 +0300 Subject: [PATCH] fix(cubeorchestrator): fix serialization of link type format for dimension --- rust/cubeorchestrator/src/transport.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rust/cubeorchestrator/src/transport.rs b/rust/cubeorchestrator/src/transport.rs index c01d29435b1f3..90901cbcb5160 100644 --- a/rust/cubeorchestrator/src/transport.rs +++ b/rust/cubeorchestrator/src/transport.rs @@ -90,6 +90,21 @@ pub enum CompareDateRangeType { Multi(Vec>), } +#[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)] +pub struct ExtendedDimensionFormat { + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(rename = "type")] + pub format_type: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DimensionFormat { + Single(String), + Extended(ExtendedDimensionFormat), +} + // We can do nothing with JS functions here, // but to keep DTOs in sync with reality, let's keep it. pub type JsFunction = String; @@ -164,7 +179,7 @@ pub struct ConfigItem { #[serde(skip_serializing_if = "Option::is_none")] pub member_type: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[serde(skip_serializing_if = "Option::is_none")] pub meta: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -198,7 +213,7 @@ pub struct AnnotatedConfigItem { #[serde(skip_serializing_if = "Option::is_none")] pub member_type: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub format: Option, + pub format: Option, #[serde(skip_serializing_if = "Option::is_none")] pub meta: Option, #[serde(skip_serializing_if = "Option::is_none")]