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

from_value in Deserializer #1233

Open
andrewbaxter opened this issue Jan 26, 2025 · 1 comment
Open

from_value in Deserializer #1233

andrewbaxter opened this issue Jan 26, 2025 · 1 comment

Comments

@andrewbaxter
Copy link

I'm deserializing to Value and doing some merging, then deserializing again into a structure. I was using serde_json::from_value for this but I want to use path-to-error and it seems like Deserializer has no from_value method.

Would it be reasonable to add this? For now I can workaround by re-serializing first.

@robsdedude
Copy link

Does the serde_path_to_errorcrate fulfill your needs?

I'll quote dtolnay #173 (comment):

Here is the library: https://github.com/dtolnay/path-to-error. You can use it to wrap any Deserializer and find out where an error occurs.

Note that Value (and &Value) itself implements serde's Deserializer trait.

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

No branches or pull requests

2 participants