epage / epage.github.io

https://epage.github.io/
2 stars 3 forks source link

serdepath #1

Closed epage closed 1 year ago

epage commented 5 years ago

An idea I had is to decorate the deserialization source with a jsonpath so you can select data inside of it that you want to be deserialized into your struct

Stage 1 Prototype is to deserialize into serde_json::Value, apply the jsonpath, and then use serde_jsons from_value to convert it into the final format.

Stage 2 is to actually make a serde Deserializable.

Stage 3 is the option of a macro for this so it has minimal runtime overhead for a purely state selection

epage commented 1 year ago

I think this exists now? I also don't need it anymore