Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Error
✓ use serde_path_to_error::Error;
Track the path to the field that caused a deserialization error
use serde_path_to_error::Error;
use serde::Deserialize;
#[derive(Deserialize)]
struct Config {
name: String,
version: u32,
}
let data = r#"{"name": "test", "version": "not_a_number"}"#;
let result: Result<Config, _> = serde_path_to_error::deserialize(&mut serde_json::Deserializer::from_str(data));
match result {
Err(err) => println!("Error at path: {}", err.path()),
Ok(_) => {}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.1.20latest on crates.io
Audit
Dependencies
No dependency data recorded yet.