Skip to content

Instantly share code, notes, and snippets.

@rrichardson
Created December 22, 2017 21:39
Show Gist options
  • Save rrichardson/5e6fee3d3ccfe69f3b933c8b7b788b70 to your computer and use it in GitHub Desktop.
Save rrichardson/5e6fee3d3ccfe69f3b933c8b7b788b70 to your computer and use it in GitHub Desktop.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(untagged)]
pub enum PlatformNotification {
Apn(
ApnNotification,
#[serde(skip)]
Url),
Gcm(
GcmNotification,
#[serde(skip)]
Url)
}
@rrichardson
Copy link
Author

produces :

[ { "aps" : { "blah" : "blah" ... }, "http://blah.com" ]

So it is untagged, but it includes the Url in the tuple.. what I want to do is just have

{ "aps" : { "oaeuoaeu" ... } }

without the 'enum' array wrapper or url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment