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
Is there a way to skip content with "unknown enums"? In my case, I would like to only deserialize RawEvent structures with a type that is present in the Type enumeration.
PS: I had a look to the documentation / GitHub issues but I could not figure it out. 😇
The text was updated successfully, but these errors were encountered:
nicokosi
changed the title
How to deserialize to enums without failing?
How to deserialize into enums without failing with unknown variant?
Aug 3, 2018
nicokosi
changed the title
How to deserialize into enums without failing with unknown variant?
How to deserialize into enums without failing with 'unknown variant'?
Aug 3, 2018
I currently use
serde_json
for a side project in order to parse GitHubevents
API's output.The GitHub
events
API returns many event types, such as:etc.
I am trying to use serde_json::from_str to parse events for a subset of event types:
It currently fails because of an
unknown variant
.Is there a way to skip content with "unknown enums"? In my case, I would like to only deserialize
RawEvent
structures with a type that is present in theType
enumeration.PS: I had a look to the documentation / GitHub issues but I could not figure it out. 😇
The text was updated successfully, but these errors were encountered: