]> Untitled Git - lemmy.git/commitdiff
Adding references to lemmy types from docs. (#1203)
authorDessalines <dessalines@users.noreply.github.com>
Thu, 15 Oct 2020 17:56:16 +0000 (13:56 -0400)
committerGitHub <noreply@github.com>
Thu, 15 Oct 2020 17:56:16 +0000 (17:56 +0000)
* Adding references to lemmy types from docs.

* Updating TOC.

* Updating docs.

docs/src/contributing_websocket_http_api.md

index 225db0bf739c8c88157048a02ff9bdd89b47c7d5..8a81b6c3514b51099cfd9a8189c54c1c3b72c5a5 100644 (file)
@@ -5,6 +5,8 @@
 <!-- toc -->
 
 - [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)
 
 ## 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.
 - <code>Option<***SomeType***></code> designates an option which may be omitted in requests and not be present in responses. It will be of type ***SomeType***.
 - <code>Vec<***SomeType***></code> 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