testAccount

joined 1 year ago
[–] testAccount@programming.dev 0 points 2 months ago

I can’t tell what the general flow of the API usage in general is. Am I supposed to login/authorize somehow first? Some common examples, especially in at least one programming language (whether that’s curl or python or whatever) I think would go a long way to help people understand what they’re supposed to do.

This could use indeed some work

How do I know if I need to authorize for a particular endpoint?

openapi spec allows one to specify the authentication, this has not be done already because there is an open issue to include auth in lemmy-js-client (I use this to generate the spec) + Need to figure the best approach to convey "elevated" auth endpoints. Endpoints like GetSite where authentication enhances the response.

Endpoint descriptions are often unhelpful.

They are actually summaries, they are fine imo. There is an open issue to add the descriptions though.

We have to guess what endpoint we might need for a lot of things. Example: /post/like is also for dislikes, but it doesn’t tell you that. It also never tells you HOW to like or dislike anything, the valid values of score do not appear to be documented. And you’re left to assume that’s the right field to even use for it.

Yes indeed, things like this should be documented in the description.

What is the content type of the request supposed to be? JSON is never mentioned anywhere.

This is explicitly mentioned on every request, visually and in the spec.

What are these named “parameters”? Is that a query parameter? Why does it say “object” and “(query)”? Does this parameter go in the request body instead?

Query is mentioned when they are query parameters, else it just a request body. This is pretty clear in the text (spec) or visually imo.

/user shows a parameter called “GetPersonDetails” except in reality this name is (I guess) supposed to be completely ignored, because no part of the request actually uses the string “GetPersonDetails”.

GetPersonDetails is the name of the object if you scroll all the way to the bottom you can inspect it. This more clear in the spec.

Schema is missing for many endpoints, like the request part of /user.

There is not a single endpoint missing nor its requests.

What are all these fields under “GetPersonDetails”? Are they all required? Only some? It doesn’t say anything about it.

This could be improved.

Many of the possible error codes are undocumented.

Status codes? or the 400 lemmy error? ex: { error: "report_reason_required" } Status codes are the same everywhere, 200/201 or 400 with Lemmy error as response. There is one exception that is 401 that can be thrown for every auth required endpoint where auth fails. But these are standard. Ig this should documented.

Now the "LemmyErrorTypes". This could be improved, but it is hard to, not possible to be automated and tedious to add and frequently changes.

Thanks for the feedback.

[–] testAccount@programming.dev 1 points 2 months ago

Ah yes, all though I ve never really experienced HTTP days in their full glory

I'll look into using it. If it has a github action or easy way to publish it from cli

[–] testAccount@programming.dev 2 points 2 months ago (2 children)

I do not see how critisms for the JS API docs are relevant for my openapi documentation.

This documentation aims to solve all those problems in a language agnostic way. It descibes the endpoints, the request object, the status, the response object, the authentication needed in visual/text. It allows you test it right from the browser, allows you to copy a working curl command, search for endpoints based on keywords, allows you to import the entire spec into postman/alts.

I ve never had any problems with CF instances but I mostly test with voyager.lemmy.ml

[–] testAccount@programming.dev 1 points 2 months ago (2 children)

Looks like the best openapi front. I looked into using it, but it didn't seem free. Too bad this one is outdated. Lemmys API has changed quiet a bit since then.

[–] testAccount@programming.dev 1 points 2 months ago (4 children)

(Author btw)

Can you expand on this? This was written for Kotlin usage. It automates generating API based on this spec.

I have no idea what you mean with 'using other approaches to calling the endpoints'

Lemmy has only one API. It's same API used for lemmy-ui.

This is just a "better" documentation for it.

The API works for for cloudfare instances too.

There is also a swagger ui variant

https://mv-gh.github.io/lemmy_openapi_spec/swagger_ui.html

[–] testAccount@programming.dev 0 points 1 year ago (1 children)

np

Can you also test if the problem is still fixed with this build and that the flick to exit works in the ImageViewer

https://github.com/dessalines/jerboa/files/12618555/fix_zooming_jerboa_debug.zip

 
[–] testAccount@programming.dev 0 points 1 year ago (3 children)

Could you test if you can still reproduce it in these builds (I can not test it myself as I can not seem to reproduce it)

I have modified some code to isolate the problem.

Release version of 46

Depending on how you installed it might not allow you to install this release version

Note replacing an existing install with this version, will probably delete your app info (it should tell you) use debug version instead if that is not wanted app-release_zoomable.zip

Debug version of 46 app-debug_zoomable.zip

[–] testAccount@programming.dev 0 points 1 year ago (5 children)

Which device do you use

[–] testAccount@programming.dev 0 points 1 year ago (1 children)

I tweaked it a bit, might resolve when ever 0.0.45 comes out

[–] testAccount@programming.dev 0 points 1 year ago (2 children)

Alright thats strange, in that version I added checks ("account verification checks") to ensure your account and device is in a proper state else it will give info to mitigate the problem. (To prevent external events, like when all the instances revoked the JWT when the hack happened and causing it to stop working for all the users) Here it fails on the first step. The first step checks if there any network capability. But from your screenshot I can clearly see you have wifi/mobile capability.

Could you give me some more information about your device/android version. In that version it now also requires the ACCESS_NETWORK_STATE permission for that check. Maybe you revoked it somehow?

The account is not ready yet msg is just that it hasnt cleared the checks yet. Maybe a better phrasing is in order but i am not sure what that is.

 

Hey folks, I created a OpenApi documentation of the Lemmy API.

https://mv-gh.github.io/lemmy_openapi_spec/