Skip to content

Conversation

johnmave126
Copy link

This is an attempt to address serde-rs/json#644

The idea is to go through a proxy type OptionFlatMapDeserializer when calling deserialize_option in FlatMapDeserializer. Such proxy type provides a custom error type FlatStructError which only catches missing_field error during the immediate struct deserialization. All the errors happening nested will be preserved in another variant. In this way, we could propagate error inside a flattened struct.

I guess some more tests and comments are needed, but I want to put this work forward for preliminary test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant