cdevents_sdk/generated/
repository_modified_0_2_0.rs#[cfg(feature = "testkit")] use proptest_derive::Arbitrary;
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "testkit", derive(Arbitrary))]
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "name", default, skip_serializing_if = "Option::is_none",)]
pub name: Option<String>,
#[serde(rename = "owner", default, skip_serializing_if = "Option::is_none",)]
pub owner: Option<String>,
#[serde(rename = "url", default, skip_serializing_if = "Option::is_none",)]
pub url: Option<String>,
#[serde(rename = "viewUrl", default, skip_serializing_if = "Option::is_none",)]
pub view_url: Option<String>,
}
#[cfg(test)]
mod tests {
use proptest::prelude::*;
use super::*;
proptest! {
#[test]
#[cfg(feature = "testkit")]
fn arbitraries_are_json_valid(s in any::<Content>()) {
let json_str = serde_json::to_string(&s).unwrap();
let actual = serde_json::from_str::<Content>(&json_str).unwrap();
assert_eq!(s, actual);
}
}
}