Implements the experimental contains filter operator«

This commit is contained in:
Tamo 2024-07-17 11:13:37 +02:00
parent 1582c7e788
commit 2af9481804
34 changed files with 484 additions and 122 deletions

View file

@ -26,6 +26,15 @@ impl Value {
panic!("Didn't find any task id in: {self}");
}
}
// Panic if the json doesn't contain the `status` field set to "succeeded"
#[track_caller]
pub fn succeeded(&self) -> &Self {
if self["status"] != serde_json::Value::String(String::from("succeeded")) {
panic!("Called succeeded on {}", serde_json::to_string_pretty(&self.0).unwrap());
}
self
}
}
impl From<serde_json::Value> for Value {