Comments (6)
Unfortunately I was wrong, the Perform
traits are absolutely necessary so that the same API handlers can be used for HTTP and websocket. Thats because HTTP handlers need to return HttpResponse
, but websocket requires plain json structs. There might be another solution by using middleware to rewrite the responses, and that way use API handlers that work with utoipa documentation macros. But thats probably not worth the effort.
So I think the better solution to document the HTTP API would be to generate docs in lemmy-js-client, like we are already doing for websocket. It already has the necessary data (structs, HTTP methods and paths). What do you think @dessalines?
from lemmy-docs.
Yes, I prefer the existing lemmy-js-client docs anyway. Those are already auto-generated from its codebase, here: https://join-lemmy.org/api/
from lemmy-docs.
The current API docs are fine, but they are only for websocket. They arent useful at all if you want to use the HTTP api, because HTTP methods or paths arent mentioned. So when building LemmyBB I had to look these things up in the source code. This is not an option for people who are not familiar with Rust, and makes it unnecessarily difficult to develop Lemmy clients. Everyone is familiar with HTTP, and is unlikely to learn websocket for a simple project. Thats why I believe we need two sets of API documentation, one for websocket and one for HTTP.
from lemmy-docs.
The paths and methods are mentioned, here's an example:
https://join-lemmy.org/api/classes/LemmyHttp.html#likePost
from lemmy-docs.
Oh thats very easy to miss, I didnt notice that at all before. Can we change the color scheme to emphasize it? Or even switch to a different frontend? The one used by Peertube looks very nice.
from lemmy-docs.
I'd rather not add anything too custom, but typedoc does look like its supports some pre-made themes: https://typedoc.org/guides/themes/
from lemmy-docs.
Related Issues (20)
- [Request] Podman Install HOT 3
- Add sources to back up "History of Lemmy"
- [Bug]: embed pictrs doesn't work HOT 1
- administration/configuration.html has a faulty link to 'defaults.hjson'
- Contributor local development postgreSQL missing a step HOT 1
- Theming section is outdated
- The client contributer example for Rust is wrong HOT 1
- Document that high db pool size requires increased shared memory for postgres HOT 4
- Suggested backup script is somewhat dangerous HOT 3
- Lemmy migration from a domain name to another HOT 2
- `docker-compose.yml` linked for manual docker install contain ansible if-statements HOT 6
- Introducing Elestio as one-click deployment option with others
- From scratch installation instructions not working HOT 10
- Json Objects in the doc are not loaded in correctly HOT 3
- [Bug]: Incorrect pathing in copy binary command in "from scratch" doc HOT 3
- Object Storage for embedded pict-rs on from scratch install? HOT 7
- Missing pg_format install instructions
- Document how to delete images (pict-rs) HOT 4
- `pnpm translations:generate` is missing in lemmy-ui local development instructions HOT 1
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemmy-docs.