use serde::Deserialize; use serde_json; #[derive(Deserialize, Debug)] struct Person { name: String, age: u8, email: String, } fn main() { let invalid_json = r#" { "name": "Reza", "age": "thirty", "email": "reza@example.com" } "#; match serde_json::from_str::<Person>(invalid_json) { Ok(person) => println!("Parsed person: {:?}", person), Err(e) => println!("Error parsing JSON: {}", e), } }