Added asynchronous responses to Join requests

This commit is contained in:
gazconroy 2021-03-22 16:00:29 +00:00
parent fffcb14632
commit 1a1ee6dc47
1 changed files with 22 additions and 3 deletions

View File

@ -56,6 +56,11 @@ info:
- **Messages** - A summary of the requests and responses (a duplication of the information in **Channels**) - **Messages** - A summary of the requests and responses (a duplication of the information in **Channels**)
- **Schemas** - An alphabetical list of the most commonly accessed data structures in the API. - **Schemas** - An alphabetical list of the most commonly accessed data structures in the API.
### The 'join' channels - CommunityJoin, ModJoin, PostJoin, UserJoin
Most API responses generate an immediate and direct (synchronous) response to to the preceding API request: one of an error or a success response.
However, for the join requests (**CommunityJoin**, **ModJoin**, **PostJoin** and **UserJoin**), you can also receive any of several as it happens (asynchronous) responses.
### The HTTP API ### The HTTP API
Lemmy also has an [HTTP API](https://join.lemmy.ml/docs/en/contributing/http_api.html) which is almost identical to the WebSocket API; however, this WebSocket API is the primary source since it also details the specifics of HTTP API calls. Lemmy also has an [HTTP API](https://join.lemmy.ml/docs/en/contributing/http_api.html) which is almost identical to the WebSocket API; however, this WebSocket API is the primary source since it also details the specifics of HTTP API calls.
@ -175,6 +180,8 @@ channels:
- Use the `username` field to return details about a local user - Use the `username` field to return details about a local user
- Use the `person_id` field to return details about a federated user. - Use the `person_id` field to return details about a federated user.
`community_id` restricts posts and comments in the response to this community.
#### HTTP API - operation and endpoint. #### HTTP API - operation and endpoint.
`GET /user` `GET /user`
@ -532,9 +539,13 @@ channels:
tags: tags:
- name: User, authentication and admin - name: User, authentication and admin
message: message:
oneOf: anyOf:
- $ref: "#/components/messages/userJoinResponse" - $ref: "#/components/messages/userJoinResponse"
- $ref: "#/components/messages/errorResponse" - $ref: "#/components/messages/errorResponse"
- $ref: "#/components/messages/createCommentLikeResponse"
- $ref: "#/components/messages/createCommentResponse"
- $ref: "#/components/messages/createPrivateMessageResponse"
- $ref: "#/components/messages/deleteCommentResponse"
GetReportCount: GetReportCount:
publish: publish:
summary: GetReportCount (request) summary: GetReportCount (request)
@ -1051,9 +1062,13 @@ channels:
tags: tags:
- name: Community - name: Community
message: message:
oneOf: anyOf:
- $ref: "#/components/messages/communityJoinResponse" - $ref: "#/components/messages/communityJoinResponse"
- $ref: "#/components/messages/errorResponse" - $ref: "#/components/messages/errorResponse"
- $ref: "#/components/messages/createPostResponse"
- $ref: "#/components/messages/editPostResponse"
- $ref: "#/components/messages/deletePostResponse"
- $ref: "#/components/messages/createPostLikeResponse"
ModJoin: ModJoin:
publish: publish:
summary: ModJoin (request) summary: ModJoin (request)
@ -1351,9 +1366,13 @@ channels:
tags: tags:
- name: Post - name: Post
message: message:
oneOf: anyOf:
- $ref: "#/components/messages/postJoinResponse" - $ref: "#/components/messages/postJoinResponse"
- $ref: "#/components/messages/errorResponse" - $ref: "#/components/messages/errorResponse"
- $ref: "#/components/messages/createCommentResponse"
- $ref: "#/components/messages/editCommentResponse"
- $ref: "#/components/messages/deleteCommentResponse"
- $ref: "#/components/messages/createPostLikeResponse"
CreatePostReport: CreatePostReport:
publish: publish:
summary: CreatePostReport (request) summary: CreatePostReport (request)