EventStore / EventStoreDB-Client-Rust

Rust EventStoreDB gRPC Client
MIT License
50 stars 13 forks source link

Creating json eventdata from str/byte #167

Closed jsiefer closed 1 year ago

jsiefer commented 1 year ago

I would be nice if one could construct json EventData from already made json.

e.g. eventstore::EventData::json_str()

YoEight commented 1 year ago

Hey @jsiefer,

You can achieve that already by using serde_json::RawValue. I think you might find that function useful: https://docs.rs/serde_json/1.0.107/serde_json/value/struct.RawValue.html#method.from_string

serde_json::RawValue implements Serialize

jsiefer commented 1 year ago

Right, good point! Thank you! (and sorry for the late reply)