serde-rs / serde-rs.github.io

https://serde.rs
Creative Commons Attribution Share Alike 4.0 International
22 stars 96 forks source link

Add a warning that `flatten` and `deny_unknown_fields` should not be mixed. #120

Closed jonasbb closed 3 years ago

jonasbb commented 3 years ago

There are various bug reports about the interaction of flatten and deny_unknown_fields. In the end they cannot really be combined, since flatten does not consume the fields thus deny_unknown_fields will error on them.

https://github.com/serde-rs/serde/issues/1957 https://github.com/serde-rs/serde/issues/1600 https://github.com/serde-rs/serde/issues/1547

I'm happy to update the wording of the notice to include any suggestions.

jonasbb commented 3 years ago

@dtolnay Thank you for the comment. Yes I messed up the description while hastily creating this PR. I fixed the mistake.