serde-ignored
serde-ignored copied to clipboard
Find out about keys that are ignored when deserializing data
Modify the README example with these instead, and nothing gets detected. ```rust #[derive(Debug, PartialEq, Deserialize)] struct Package { #[serde(flatten)] pub sub: SubPackage, } #[derive(Debug, PartialEq, Deserialize)] struct SubPackage { name:...
For example, if deserializing something like ```toml [dependencies] serde = { version = "1.0.126", optional = true, feautres = ["derive"] } ``` With something like ```rust let manifest: TomlManifest =...
Drop-in unit test: ``` #[test] fn test_internally_tagged_enum() { #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Deserialize)] struct Struct { field: String, } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Deserialize)] #[serde(tag = "type")] enum...
It seems that ignored fields are not detected if the structure contains the flattened field. It probably relates to the serde issue, that `flatten` and `deny_unkown_fields` cannot be combined (https://github.com/jonasbb/serde-rs.github.io/commit/af0e2e68c98cd2a8411cf194156aabb8316f9cea)....
Is there any way to get the spans of the ignored keys? The only way I can think of doing this right now would be to copy what this crate...
This change allows the caller to specify a type `S` which will be used to deserialize ignored values. The deserialized value will then be passed to the callback. This can...
For example by passing into the closure a Deserializer from which you can read the value.