Skip to content
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

Closed
lucab opened this issue Apr 27, 2017 · 4 comments
Closed

serde: support for validation during deserialization #22

lucab opened this issue Apr 27, 2017 · 4 comments

Comments

@lucab
Copy link

lucab commented Apr 27, 2017

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).

@Keats
Copy link
Owner

Keats commented Apr 28, 2017

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

@ckaran
Copy link

ckaran commented Feb 5, 2020

Has there been any progress on this?

@Keats
Copy link
Owner

Keats commented Feb 5, 2020

serde doesn't have hooks for that so no

@ckaran
Copy link

ckaran commented Feb 5, 2020

Are there any plans to add in the necessary hooks?

@Keats Keats closed this as completed Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants