mirror of
https://github.com/trussed-dev/serde-indexed.git
synced 2026-06-20 04:16:32 -07:00
Allow unexpected fields
This commit is contained in:
+5
-1
@@ -6,9 +6,13 @@
|
||||
|
||||
- Add support for `#[serde(skip)]` ([#14][])
|
||||
- Add support for generics ([#11][])
|
||||
- skip_serializing_if no longer incorrectly affects deserialization (fixes [#2][])
|
||||
- No longer fails deserialising maps with unknown fields ([#19][])
|
||||
|
||||
[#14]: https://github.com/trussed-dev/serde-indexed/pull/14
|
||||
[#2]: https://github.com/trussed-dev/serde-indexed/issues/2
|
||||
[#11]: https://github.com/trussed-dev/serde-indexed/pull/11
|
||||
[#14]: https://github.com/trussed-dev/serde-indexed/pull/14
|
||||
[#19]: https://github.com/trussed-dev/serde-indexed/pull/19
|
||||
|
||||
## [v0.1.1][] (2024-04-03)
|
||||
|
||||
|
||||
+2
-1
@@ -224,7 +224,8 @@ pub fn derive_deserialize(input: TokenStream) -> TokenStream {
|
||||
match __serde_indexed_internal_key {
|
||||
#(#match_fields)*
|
||||
_ => {
|
||||
return Err(serde::de::Error::duplicate_field("inexistent field index"));
|
||||
// Ignore unknown keys by consuming their value
|
||||
let _ = map.next_value::<serde::de::IgnoredAny>()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user