Skip to content
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

feat: added meta field to ClientFeatures #44

Merged
merged 8 commits into from
Jan 6, 2025
Next Next commit
feat: added meta field to ClientFeatures
  • Loading branch information
chriswk committed Dec 20, 2024
commit 1c0c48a2be09b90077e7e571d976c27a3850bbc8
11 changes: 11 additions & 0 deletions src/client_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ pub struct ClientFeature {
pub dependencies: Option<Vec<FeatureDependency>>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default)]
#[cfg_attr(feature = "openapi", derive(ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct Meta {
pub etag: Option<String>,
}

impl Merge for ClientFeatures {
fn merge(self, other: Self) -> Self {
let mut features = self.features.merge(other.features);
Expand All @@ -389,6 +396,7 @@ impl Merge for ClientFeatures {
s
}),
query: self.query.or(other.query),
meta: other.meta,
}
}
}
Expand All @@ -414,6 +422,7 @@ impl Upsert for ClientFeatures {
s
}),
query: self.query.or(other.query),
meta: other.meta,
}
}
}
Expand Down Expand Up @@ -450,6 +459,8 @@ pub struct ClientFeatures {
#[serde(skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Segment>>,
pub query: Option<Query>,
#[serde(skip_serializing_if = "Option::is_none")]
pub meta: Option<Meta>,
}

#[cfg(feature = "hashes")]
Expand Down
Loading