You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
489 B
24 lines
489 B
3 years ago
|
use crate::model::ObjectModel;
|
||
|
|
||
|
#[test]
|
||
|
fn test1() {
|
||
|
let model = crate::model::ObjectModel {
|
||
|
id: Default::default(),
|
||
|
name: "Name".to_string(),
|
||
|
parent: None
|
||
|
};
|
||
|
|
||
|
println!("{}", serde_json::to_string_pretty(&model).unwrap());
|
||
|
|
||
|
let s = r#"
|
||
|
{
|
||
|
"name": "Name",
|
||
|
"parent_tpl_id": null
|
||
|
}
|
||
|
"#;
|
||
|
|
||
|
let x : ObjectModel = serde_json::from_str(s).unwrap();
|
||
|
|
||
|
println!("{}", serde_json::to_string_pretty(&x).unwrap());
|
||
|
}
|