Closed sidju closed 2 years ago
Example code to show the issue: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=94d7a3f065abfc116c3648befd9fdd13 (Note how size from the input is silently dropped)
I think you might be looking for #[serde(deny_unknown_fields)]
.
https://serde.rs/container-attrs.html#deny_unknown_fields
I don't know how I missed that... (except probably coding when I should have been sleeping) Thank you, and sorry for taking up your time with such a stupid mistake.
This may be because I have tagged my structs with serde(default, rename_all = "camelCase"), but when my source file contains a field that isn't handled the deserializer just ignores it instead of raising an error.
Is it the intended behaviour to not raise an error on unhandled fields when deserializing yaml? Is there some feature I'm missing to change this behaviour?