svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
23 stars 11 forks source link

Correctly document the photos like endpoints #2633

Open JAicewizard opened 1 year ago

JAicewizard commented 1 year ago

Describe the change

The documentation should contain information about what kind of value is returned.

Motivation

The return value in the documentation is extremely lacking; [null], which is not very useful. Opening the get https://thalia.nu/api/v2/photos/photos/{id}/like/ in the browser is much more useful.

Current implementation

There is no real documentation because there is no information.

Suggested implementation

Have real documentation.

Additional context

Maybe someone should sweep the documentation and look for things that are lacking or contain useless values like null.

se-bastiaan commented 1 year ago

I have edited your issue to follow the template. But I am not sure how easy it is to do what you're asking. The documentation is auto generated based on the implementation. So it is not so easy to 'sweep the documentation' because there is no static source file for what you see in swagger.

@JobDoesburg is this endpoint meant to be /api/v2/photos/photos/{id}/like/? Based on how the rest of the API is designed shouldn't it be /api/v2/photos/{id}/like/?

se-bastiaan commented 1 year ago

I see why this is not working. The endpoints do not use a serializer 😞 We use Django rest framework for everything and this is not using it for the responses.

This should probably be rewritten as something like this: