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
Not sure if it's possible to do this in a nice way, but would be awesome if there was a way that didn't require manual deserialization. So, I'm trying to parse Matrix API responses, and one part of the JSON response has a content object that can look like this:
But the actual fields in the object varies based on the msgtype field, so I want to have an enum with named fields and then deserialize into cases of this enum. Is it possible to do this in a nice way with serde?
The text was updated successfully, but these errors were encountered:
We don't have something for this currently, but it would be a good candidate for a helper library. The other pattern that people commonly ask about is:
Not sure if it's possible to do this in a nice way, but would be awesome if there was a way that didn't require manual deserialization. So, I'm trying to parse Matrix API responses, and one part of the JSON response has a content object that can look like this:
But the actual fields in the object varies based on the
msgtype
field, so I want to have an enum with named fields and then deserialize into cases of this enum. Is it possible to do this in a nice way with serde?The text was updated successfully, but these errors were encountered: