From 24484ed80138e71eca2ec596676d772948a23ba1 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 15 Oct 2020 13:56:16 -0400 Subject: [PATCH] Adding references to lemmy types from docs. (#1203) * Adding references to lemmy types from docs. * Updating TOC. * Updating docs. --- docs/src/contributing_websocket_http_api.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/src/contributing_websocket_http_api.md b/docs/src/contributing_websocket_http_api.md index 225db0bf..8a81b6c3 100644 --- a/docs/src/contributing_websocket_http_api.md +++ b/docs/src/contributing_websocket_http_api.md @@ -5,6 +5,8 @@ - [Data types](#data-types) + * [Lemmy types](#lemmy-types) + * [Lower-level types](#lower-level-types) - [Basic usage](#basic-usage) * [WebSocket](#websocket) + [Testing with Websocat](#testing-with-websocat) @@ -265,11 +267,28 @@ ## Data types +### Lemmy types + +The fields for objects like Users, Comments, Communities, and Posts, are in the [lemmy_db](https://github.com/LemmyNet/lemmy/tree/main/lemmy_db/src) folder, with the suffix `_view`. The main types are: + +- [CommentView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/comment_view.rs) +- [CommunityView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/community_view.rs) +- [PostView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/post_view.rs) +- [UserView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/user_view.rs) +- [PrivateMessageView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/private_message_view.rs) +- [UserMentionView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/user_mention_view.rs) +- [SiteView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/site_view.rs) +- [Category](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/category.rs) +- [Moderator Views](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/moderator_views.rs) + +The requests and responses, although copied below, are most up to date in [lemmy_structs](https://github.com/LemmyNet/lemmy/tree/main/lemmy_structs/src). + +### Lower-level types + - `i16`, `i32` and `i64` are respectively [16-bit](https://en.wikipedia.org/wiki/16-bit), [32-bit](https://en.wikipedia.org/wiki/32-bit) and [64-bit](https://en.wikipedia.org/wiki/64-bit_computing) integers. - Option<***SomeType***> designates an option which may be omitted in requests and not be present in responses. It will be of type ***SomeType***. - Vec<***SomeType***> is a list which contains objects of type ***SomeType***. - `chrono::NaiveDateTime` is a timestamp string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Timestamps will be UTC. -- Other data types are listed [here](../src/db). ## Basic usage -- 2.44.1