diff --git a/static/scripts/asyncapi.yaml b/static/scripts/asyncapi.yaml index 8c93362..5481f5e 100644 --- a/static/scripts/asyncapi.yaml +++ b/static/scripts/asyncapi.yaml @@ -7,17 +7,25 @@ info: url: https://mastodon.social/@LemmyDev description: |- ### About Lemmy + [**Lemmy**](https://github.com/LemmyNet/lemmy) is a decentralized alternative to proprietary link aggregators such as Reddit. + #### More information... + - [Install your own server](https://join.lemmy.ml/docs/en/administration/administration.html) - - [API reference](link_here) + - [API reference](https://join.lemmy.ml/docs/en/contributing/api_reference.html) + - [HTTP API](https://join.lemmy.ml/docs/en/contributing/http_api.html) + ### How to use this WebSocket API document + You can either use it to: + - **Interactively browse the WebSocket API.** Browse the *Channels*, check out the responses and examples (tailor the *PUBLISH* requests to suit with your favorite WebSocket client). For testing purposes, either [set up your own server](https://join.lemmy.ml/docs/en/administration/administration.html) or use the Enterprise server (*ws://enterprise.lemmy.ml/api/v2/ws*) - **[Open and save](asyncapi.yaml) this specification file** and use it with the various [AsyncAPI tools](https://www.asyncapi.com/docs/community/tooling) (perhaps to generate code or documentation). Connect to ws://***host***/api/v2/ws to get started. If the server supports secure connections, you can use `wss://**server**/api/v1/ws`. + #### Testing with websocat For example a simple test using [websocat](https://github.com/vi/websocat) might be: @@ -42,12 +50,15 @@ info: ``` ### Structure of this document + - **Channels** - Documents the requests (marked with the PUBLISH button) and responses (marked with SUBSCRIBE) for each endpoint (*channel*) - **Servers** - Lists some publicly-accessible test servers - **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. + ### The HTTP API - Lemmy also has an [HTTP API](link_here) 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. license: name: AGPL