Open lucab opened 7 years ago
Ah yes that would be a cleaner approach than what I was thinking with #11
I'm pretty busy with Tera and Gutenberg currently but I'll resume work on that once Gutenberg gets closer to 0.1
Ideally I'd also like as much feedback as possible on #10 before starting up again to ensure I'm not missing any usecase and have to rewrite the whole thing
Has there been any progress on this?
serde doesn't have hooks for that so no
Are there any plans to add in the necessary hooks?
This is basically cross-linking the whole discussion at https://github.com/serde-rs/serde/issues/642.
It would be nice to have this crate and serde team-up to provide some way for performing a validation pass as the last step of deserialization. For simple average-case scenarios, I'd like to avoid explicitely calling
validate()
on a struct that has just been deserialized by serde.The usecase for this is to automatically ensure that a struct is guaranteed to be either valid right after deserialization or to fail it, in order to avoid invalid states between deserialization and validation (or worse, missing validation at some call sites).