Skip to content

fix(cubeorchestrator): Fix serialization of link type format for dimension #9649

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 17 additions & 2 deletions rust/cubeorchestrator/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ pub enum CompareDateRangeType {
Multi(Vec<Vec<String>>),
}

#[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)]
pub struct ExtendedDimensionFormat {
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[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;
Expand Down Expand Up @@ -164,7 +179,7 @@ pub struct ConfigItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub member_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
pub format: Option<DimensionFormat>,
#[serde(skip_serializing_if = "Option::is_none")]
pub meta: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -198,7 +213,7 @@ pub struct AnnotatedConfigItem {
#[serde(skip_serializing_if = "Option::is_none")]
pub member_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
pub format: Option<DimensionFormat>,
#[serde(skip_serializing_if = "Option::is_none")]
pub meta: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
Loading