You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GDAX API full channel is a JSON API whose messages include numerical values that are for some reason encoded as strings. In order to parse these messages, I've had to implement manual parsing, but it'd be nice if there were some attribute that I could use to instruct serde_json to attempt to parse string-typed values as other types.
The from_str helper from #317 (comment) looks like it would work for any type that implements FromStr. Does that cover all the types in the GDAX API full channel?
Yeah, that's roughly what I've done in my implementation.
However, this gets tricky when you want to nest those fields. For example, if instead of having an f64 field, you want it to be optional, making it an Option<f64> field, then the attribute isn't sufficient. I ended up writing my own type - struct F64(f64) - and then using Option<F64>. It'd be nice if instead I could just do something like:
The GDAX API full channel is a JSON API whose messages include numerical values that are for some reason encoded as strings. In order to parse these messages, I've had to implement manual parsing, but it'd be nice if there were some attribute that I could use to instruct serde_json to attempt to parse string-typed values as other types.
Example message from that API:
The text was updated successfully, but these errors were encountered: