1 use serde::{Deserialize, Serialize};
4 pub(crate) mod chat_message;
9 pub(crate) mod tombstone;
11 #[derive(Clone, Debug, Deserialize, Serialize)]
12 #[serde(rename_all = "camelCase")]
13 pub struct Endpoints {
14 pub shared_inbox: Url,
21 objects::tests::file_to_json_object,
23 objects::{chat_message::ChatMessage, group::Group, note::Note, page::Page, person::Person},
24 tests::test_parse_lemmy_item,
29 async fn test_parse_object_lemmy() {
30 test_parse_lemmy_item::<Person>("assets/lemmy/objects/person.json");
31 test_parse_lemmy_item::<Group>("assets/lemmy/objects/group.json");
32 test_parse_lemmy_item::<Page>("assets/lemmy/objects/page.json");
33 test_parse_lemmy_item::<Note>("assets/lemmy/objects/note.json");
34 test_parse_lemmy_item::<ChatMessage>("assets/lemmy/objects/chat_message.json");
38 async fn test_parse_object_pleroma() {
39 file_to_json_object::<WithContext<Person>>("assets/pleroma/objects/person.json").unwrap();
40 file_to_json_object::<WithContext<Note>>("assets/pleroma/objects/note.json").unwrap();
41 file_to_json_object::<WithContext<ChatMessage>>("assets/pleroma/objects/chat_message.json")
46 async fn test_parse_object_smithereen() {
47 file_to_json_object::<WithContext<Person>>("assets/smithereen/objects/person.json").unwrap();
48 file_to_json_object::<Note>("assets/smithereen/objects/note.json").unwrap();
52 async fn test_parse_object_mastodon() {
53 file_to_json_object::<Person>("assets/mastodon/objects/person.json").unwrap();
54 file_to_json_object::<Note>("assets/mastodon/objects/note.json").unwrap();
58 async fn test_parse_object_lotide() {
59 file_to_json_object::<WithContext<Group>>("assets/lotide/objects/group.json").unwrap();
60 file_to_json_object::<WithContext<Person>>("assets/lotide/objects/person.json").unwrap();
61 file_to_json_object::<WithContext<Note>>("assets/lotide/objects/note.json").unwrap();
62 file_to_json_object::<WithContext<Page>>("assets/lotide/objects/page.json").unwrap();