From d50ac62d18d2be94632025b9107772cd75a9c60f Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 28 Jan 2019 12:57:03 -0600 Subject: [PATCH] Add ActivityStreams 1.0 aliases for AS 2 fields --- activitystreams-types/src/activity/accept.rs | 2 ++ activitystreams-types/src/activity/add.rs | 2 ++ activitystreams-types/src/activity/amove.rs | 2 ++ .../src/activity/announce.rs | 2 ++ activitystreams-types/src/activity/arrive.rs | 2 ++ activitystreams-types/src/activity/block.rs | 2 ++ activitystreams-types/src/activity/create.rs | 2 ++ activitystreams-types/src/activity/delete.rs | 2 ++ activitystreams-types/src/activity/dislike.rs | 2 ++ activitystreams-types/src/activity/flag.rs | 2 ++ activitystreams-types/src/activity/follow.rs | 2 ++ activitystreams-types/src/activity/ignore.rs | 2 ++ activitystreams-types/src/activity/invite.rs | 2 ++ activitystreams-types/src/activity/join.rs | 2 ++ activitystreams-types/src/activity/leave.rs | 2 ++ activitystreams-types/src/activity/like.rs | 2 ++ activitystreams-types/src/activity/listen.rs | 2 ++ activitystreams-types/src/activity/offer.rs | 2 ++ .../src/activity/properties.rs | 2 ++ .../src/activity/question.rs | 2 ++ activitystreams-types/src/activity/read.rs | 2 ++ activitystreams-types/src/activity/reject.rs | 2 ++ activitystreams-types/src/activity/remove.rs | 2 ++ .../src/activity/tentative_accept.rs | 2 ++ .../src/activity/tentative_reject.rs | 2 ++ activitystreams-types/src/activity/travel.rs | 2 ++ activitystreams-types/src/activity/undo.rs | 2 ++ activitystreams-types/src/activity/update.rs | 2 ++ activitystreams-types/src/activity/view.rs | 2 ++ activitystreams-types/src/actor/mod.rs | 10 ++++++++ activitystreams-types/src/collection/mod.rs | 8 +++++++ activitystreams-types/src/link/mod.rs | 2 ++ activitystreams-types/src/object/mod.rs | 24 +++++++++++++++++++ .../src/object/properties.rs | 2 ++ 34 files changed, 104 insertions(+) diff --git a/activitystreams-types/src/activity/accept.rs b/activitystreams-types/src/activity/accept.rs index 7d50a5a..7b440af 100644 --- a/activitystreams-types/src/activity/accept.rs +++ b/activitystreams-types/src/activity/accept.rs @@ -34,6 +34,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Accept { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: AcceptType, /// Adds all valid accept properties to this struct diff --git a/activitystreams-types/src/activity/add.rs b/activitystreams-types/src/activity/add.rs index 6ec50b2..8c81a56 100644 --- a/activitystreams-types/src/activity/add.rs +++ b/activitystreams-types/src/activity/add.rs @@ -35,6 +35,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Add { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: AddType, /// Adds all valid add properties to this struct diff --git a/activitystreams-types/src/activity/amove.rs b/activitystreams-types/src/activity/amove.rs index fd9156d..eff4200 100644 --- a/activitystreams-types/src/activity/amove.rs +++ b/activitystreams-types/src/activity/amove.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct AMove { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: MoveType, /// Adds all valid move properties to this struct diff --git a/activitystreams-types/src/activity/announce.rs b/activitystreams-types/src/activity/announce.rs index 6e2bd4e..947eb7b 100644 --- a/activitystreams-types/src/activity/announce.rs +++ b/activitystreams-types/src/activity/announce.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Announce { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: AnnounceType, /// Adds all valid announce properties to this struct diff --git a/activitystreams-types/src/activity/arrive.rs b/activitystreams-types/src/activity/arrive.rs index 5c81e70..da49a6c 100644 --- a/activitystreams-types/src/activity/arrive.rs +++ b/activitystreams-types/src/activity/arrive.rs @@ -34,6 +34,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Arrive { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: ArriveType, /// Adds all valid arrive properties to this struct diff --git a/activitystreams-types/src/activity/block.rs b/activitystreams-types/src/activity/block.rs index 591692d..4e82d11 100644 --- a/activitystreams-types/src/activity/block.rs +++ b/activitystreams-types/src/activity/block.rs @@ -35,6 +35,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Block { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: BlockType, /// Adds all valid block properties to this struct diff --git a/activitystreams-types/src/activity/create.rs b/activitystreams-types/src/activity/create.rs index 5eb7b0b..3d9235d 100644 --- a/activitystreams-types/src/activity/create.rs +++ b/activitystreams-types/src/activity/create.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Create { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: CreateType, /// Adds all valid create properties to this struct diff --git a/activitystreams-types/src/activity/delete.rs b/activitystreams-types/src/activity/delete.rs index e37aaab..155c674 100644 --- a/activitystreams-types/src/activity/delete.rs +++ b/activitystreams-types/src/activity/delete.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Delete { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: DeleteType, /// Adds all valid delete properties to this struct diff --git a/activitystreams-types/src/activity/dislike.rs b/activitystreams-types/src/activity/dislike.rs index 068c88f..990a6ad 100644 --- a/activitystreams-types/src/activity/dislike.rs +++ b/activitystreams-types/src/activity/dislike.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Dislike { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: DislikeType, /// Adds all valid dislike properties to this struct diff --git a/activitystreams-types/src/activity/flag.rs b/activitystreams-types/src/activity/flag.rs index 1f81095..00c6994 100644 --- a/activitystreams-types/src/activity/flag.rs +++ b/activitystreams-types/src/activity/flag.rs @@ -34,6 +34,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Flag { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: FlagType, /// Adds all valid flag properties to this struct diff --git a/activitystreams-types/src/activity/follow.rs b/activitystreams-types/src/activity/follow.rs index c7ac44f..4af6cb6 100644 --- a/activitystreams-types/src/activity/follow.rs +++ b/activitystreams-types/src/activity/follow.rs @@ -35,6 +35,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Follow { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: FollowType, /// Adds all valid follow properties to this struct diff --git a/activitystreams-types/src/activity/ignore.rs b/activitystreams-types/src/activity/ignore.rs index a5992c4..8ba1a28 100644 --- a/activitystreams-types/src/activity/ignore.rs +++ b/activitystreams-types/src/activity/ignore.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Ignore { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: IgnoreType, /// Adds all valid ignore properties to this struct diff --git a/activitystreams-types/src/activity/invite.rs b/activitystreams-types/src/activity/invite.rs index bde27e6..5994954 100644 --- a/activitystreams-types/src/activity/invite.rs +++ b/activitystreams-types/src/activity/invite.rs @@ -32,6 +32,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Invite { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: InviteType, /// Adds all valid invite properties to this struct diff --git a/activitystreams-types/src/activity/join.rs b/activitystreams-types/src/activity/join.rs index 513aecf..ca89d5c 100644 --- a/activitystreams-types/src/activity/join.rs +++ b/activitystreams-types/src/activity/join.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Join { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: JoinType, /// Adds all valid join properties to this struct diff --git a/activitystreams-types/src/activity/leave.rs b/activitystreams-types/src/activity/leave.rs index 1622ae4..efedb4a 100644 --- a/activitystreams-types/src/activity/leave.rs +++ b/activitystreams-types/src/activity/leave.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Leave { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: LeaveType, /// Adds all valid leave properties to this struct diff --git a/activitystreams-types/src/activity/like.rs b/activitystreams-types/src/activity/like.rs index 406f024..a1d80c5 100644 --- a/activitystreams-types/src/activity/like.rs +++ b/activitystreams-types/src/activity/like.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Like { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: LikeType, /// Adds all valid like properties to this struct diff --git a/activitystreams-types/src/activity/listen.rs b/activitystreams-types/src/activity/listen.rs index aa14be9..3437238 100644 --- a/activitystreams-types/src/activity/listen.rs +++ b/activitystreams-types/src/activity/listen.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Listen { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: ListenType, /// Adds all valid listen properties to this struct diff --git a/activitystreams-types/src/activity/offer.rs b/activitystreams-types/src/activity/offer.rs index b340cae..c26cbec 100644 --- a/activitystreams-types/src/activity/offer.rs +++ b/activitystreams-types/src/activity/offer.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Offer { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: OfferType, /// Adds all valid object properties to this struct diff --git a/activitystreams-types/src/activity/properties.rs b/activitystreams-types/src/activity/properties.rs index 6e8216b..eb7c815 100644 --- a/activitystreams-types/src/activity/properties.rs +++ b/activitystreams-types/src/activity/properties.rs @@ -38,6 +38,8 @@ //! #[serde(rename_all = "camelCase")] //! pub struct MyActivity { //! #[serde(rename = "type")] +//! #[serde(alias = "objectType")] +//! #[serde(alias = "verb")] //! pub kind: String, //! //! /// Define a require property for the MyActivity type diff --git a/activitystreams-types/src/activity/question.rs b/activitystreams-types/src/activity/question.rs index b3230ff..c49d40b 100644 --- a/activitystreams-types/src/activity/question.rs +++ b/activitystreams-types/src/activity/question.rs @@ -38,6 +38,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Question { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: QuestionType, /// Adds all valid question properties to this struct diff --git a/activitystreams-types/src/activity/read.rs b/activitystreams-types/src/activity/read.rs index 7d51410..a4bd949 100644 --- a/activitystreams-types/src/activity/read.rs +++ b/activitystreams-types/src/activity/read.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Read { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: ReadType, /// Adds all valid read properties to this struct diff --git a/activitystreams-types/src/activity/reject.rs b/activitystreams-types/src/activity/reject.rs index e638422..3bf51d7 100644 --- a/activitystreams-types/src/activity/reject.rs +++ b/activitystreams-types/src/activity/reject.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Reject { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: RejectType, /// Adds all valid reject properties to this struct diff --git a/activitystreams-types/src/activity/remove.rs b/activitystreams-types/src/activity/remove.rs index 0feb67f..a21e85c 100644 --- a/activitystreams-types/src/activity/remove.rs +++ b/activitystreams-types/src/activity/remove.rs @@ -33,6 +33,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Remove { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: RemoveType, /// Adds all valid remove properties to this struct diff --git a/activitystreams-types/src/activity/tentative_accept.rs b/activitystreams-types/src/activity/tentative_accept.rs index 4e65227..19bf0c2 100644 --- a/activitystreams-types/src/activity/tentative_accept.rs +++ b/activitystreams-types/src/activity/tentative_accept.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct TentativeAccept { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: TentativeAcceptType, /// Adds all valid tentative_accept properties to this struct diff --git a/activitystreams-types/src/activity/tentative_reject.rs b/activitystreams-types/src/activity/tentative_reject.rs index 9160c0f..4973ded 100644 --- a/activitystreams-types/src/activity/tentative_reject.rs +++ b/activitystreams-types/src/activity/tentative_reject.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct TentativeReject { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: TentativeRejectType, /// Adds all valid tentative_reject properties to this struct diff --git a/activitystreams-types/src/activity/travel.rs b/activitystreams-types/src/activity/travel.rs index abc0b8a..455445a 100644 --- a/activitystreams-types/src/activity/travel.rs +++ b/activitystreams-types/src/activity/travel.rs @@ -34,6 +34,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Travel { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: TravelType, /// Adds all valid travel properties to this struct diff --git a/activitystreams-types/src/activity/undo.rs b/activitystreams-types/src/activity/undo.rs index 7285012..6344dfb 100644 --- a/activitystreams-types/src/activity/undo.rs +++ b/activitystreams-types/src/activity/undo.rs @@ -37,6 +37,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Undo { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: UndoType, /// Adds all valid undo properties to this struct diff --git a/activitystreams-types/src/activity/update.rs b/activitystreams-types/src/activity/update.rs index a4d6605..24d760e 100644 --- a/activitystreams-types/src/activity/update.rs +++ b/activitystreams-types/src/activity/update.rs @@ -36,6 +36,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct Update { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: UpdateType, /// Adds all valid update properties to this struct diff --git a/activitystreams-types/src/activity/view.rs b/activitystreams-types/src/activity/view.rs index c9b1336..3bd67f2 100644 --- a/activitystreams-types/src/activity/view.rs +++ b/activitystreams-types/src/activity/view.rs @@ -31,6 +31,8 @@ use object::{properties::ObjectProperties, ObjectExt}; #[serde(rename_all = "camelCase")] pub struct View { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] pub kind: ViewType, /// Adds all valid view properties to this struct diff --git a/activitystreams-types/src/actor/mod.rs b/activitystreams-types/src/actor/mod.rs index 72893a2..5fa0fd3 100644 --- a/activitystreams-types/src/actor/mod.rs +++ b/activitystreams-types/src/actor/mod.rs @@ -31,6 +31,8 @@ use self::kind::*; #[serde(rename_all = "camelCase")] pub struct Application { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: ApplicationType, /// Adds all valid object properties to this struct @@ -55,6 +57,8 @@ impl Actor for Application {} #[serde(rename_all = "camelCase")] pub struct Group { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: GroupType, /// Adds all valid object properties to this struct @@ -79,6 +83,8 @@ impl Actor for Group {} #[serde(rename_all = "camelCase")] pub struct Organization { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: OrganizationType, /// Adds all valid object properties to this struct @@ -103,6 +109,8 @@ impl Actor for Organization {} #[serde(rename_all = "camelCase")] pub struct Person { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: PersonType, /// Adds all valid object properties to this struct @@ -127,6 +135,8 @@ impl Actor for Person {} #[serde(rename_all = "camelCase")] pub struct Service { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: ServiceType, /// Adds all valid object properties to this struct diff --git a/activitystreams-types/src/collection/mod.rs b/activitystreams-types/src/collection/mod.rs index 43f9833..3bd5997 100644 --- a/activitystreams-types/src/collection/mod.rs +++ b/activitystreams-types/src/collection/mod.rs @@ -49,6 +49,8 @@ pub trait CollectionPageExt: CollectionPage { #[serde(rename_all = "camelCase")] pub struct UnorderedCollection { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: CollectionType, /// Adds all valid object properties to this struct @@ -87,6 +89,8 @@ impl CollectionExt for UnorderedCollection { #[serde(rename_all = "camelCase")] pub struct OrderedCollection { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: OrderedCollectionType, /// Adds all valid object properties to this struct @@ -124,6 +128,8 @@ impl CollectionExt for OrderedCollection { #[serde(rename_all = "camelCase")] pub struct UnorderedCollectionPage { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: CollectionPageType, /// Adds all valid object properties to this struct @@ -175,6 +181,8 @@ impl CollectionPageExt for UnorderedCollectionPage { #[serde(rename_all = "camelCase")] pub struct OrderedCollectionPage { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: OrderedCollectionPageType, /// Adds all valid object properties to this struct diff --git a/activitystreams-types/src/link/mod.rs b/activitystreams-types/src/link/mod.rs index ee9d382..2a8a7fa 100644 --- a/activitystreams-types/src/link/mod.rs +++ b/activitystreams-types/src/link/mod.rs @@ -39,6 +39,8 @@ pub trait LinkExt: Link { #[serde(rename_all = "camelCase")] pub struct Mention { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: MentionType, /// Adds all valid link properties to this struct diff --git a/activitystreams-types/src/object/mod.rs b/activitystreams-types/src/object/mod.rs index a20151f..865e5cf 100644 --- a/activitystreams-types/src/object/mod.rs +++ b/activitystreams-types/src/object/mod.rs @@ -39,6 +39,8 @@ pub trait ObjectExt: Object { #[serde(rename_all = "camelCase")] pub struct Article { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: ArticleType, /// Adds all valid object properties to this struct @@ -62,6 +64,8 @@ impl ObjectExt for Article { #[serde(rename_all = "camelCase")] pub struct Audio { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: AudioType, /// Adds all valid object properties to this struct @@ -85,6 +89,8 @@ impl ObjectExt for Audio { #[serde(rename_all = "camelCase")] pub struct Document { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: DocumentType, /// Adds all valid object properties to this struct @@ -108,6 +114,8 @@ impl ObjectExt for Document { #[serde(rename_all = "camelCase")] pub struct Event { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: EventType, /// Adds all valid object properties to this struct @@ -131,6 +139,8 @@ impl ObjectExt for Event { #[serde(rename_all = "camelCase")] pub struct Image { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: ImageType, /// Adds all valid object properties to this struct @@ -154,6 +164,8 @@ impl ObjectExt for Image { #[serde(rename_all = "camelCase")] pub struct Note { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: NoteType, /// Adds all valid object properties to this struct @@ -177,6 +189,8 @@ impl ObjectExt for Note { #[serde(rename_all = "camelCase")] pub struct Page { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: PageType, /// Adds all valid object properties to this struct @@ -217,6 +231,8 @@ impl ObjectExt for Page { #[serde(rename_all = "camelCase")] pub struct Place { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: PlaceType, /// Adds all valid object properties to this struct @@ -247,6 +263,8 @@ impl ObjectExt for Place { #[serde(rename_all = "camelCase")] pub struct Profile { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: ProfileType, /// Adds all valid object properties to this struct @@ -287,6 +305,8 @@ impl ObjectExt for Profile { #[serde(rename_all = "camelCase")] pub struct Relationship { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: RelationshipType, /// Adds all valid object properties to this struct @@ -317,6 +337,8 @@ impl ObjectExt for Relationship { #[serde(rename_all = "camelCase")] pub struct Tombstone { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: TombstoneType, /// Adds all valid object properties to this struct @@ -344,6 +366,8 @@ impl ObjectExt for Tombstone { #[serde(rename_all = "camelCase")] pub struct Video { #[serde(rename = "type")] + #[serde(alias = "objectType")] + #[serde(alias = "verb")] kind: VideoType, /// Adds all valid object properties to this struct diff --git a/activitystreams-types/src/object/properties.rs b/activitystreams-types/src/object/properties.rs index a08df67..d0b6da6 100644 --- a/activitystreams-types/src/object/properties.rs +++ b/activitystreams-types/src/object/properties.rs @@ -83,6 +83,7 @@ pub struct ObjectProperties { /// - Range: `anyUri` /// - Functional: true #[serde(skip_serializing_if = "Option::is_none")] + #[serde(alias = "@id")] #[activitystreams(concrete(String), functional)] pub id: Option, @@ -153,6 +154,7 @@ pub struct ObjectProperties { /// - Range: `xsd:string` | `rdf:langString` /// - Functional: false #[serde(skip_serializing_if = "Option::is_none")] + #[serde(alias = "displayName")] #[activitystreams(concrete(String))] pub name: Option,