Can I use serde to deserialize from json/yaml not just a value, but the location (line number/column) that value was serialized at?
I'm writing a parsing system where the parsing itself is fairly straightforward, but there are additional business rules that are applied after parsing, and I'd like to be able to report an error back to the customer like "at line 71, reference to ID "x" that was not found in the document". Or "At line 1004, cannot nest an item of type X inside of type Y."
Thanks… that seems to be what I need. It’s too bad that there isn’t a serde-generic version of this also since that could bridge serialization formats like json/yaml. I guess I could just use a forked serde-yaml though since it’s a superset of json.