-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serde: support for validation during deserialization #22
Comments
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 serde-rs/serde#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).
The text was updated successfully, but these errors were encountered: