I have taken a pass over another set of endpoints, this time the /user endpoints. Overall, there were less changes to these endpoints compared to previous groups I have done. Most of the work for this group focused on the /user/notifications endpoint. This is because marshmallow (the python library doing the schema validation for us) doesn’t allow any kind of polymorphism in its schemata, thereby preventing the use of the anyOf part of the OpenAPI spec. So, I had to define a base notification schema and then tried to document the optional fields to indicate what fields would be present for which type of notification.
Here is crust running the updated swagger and here is the codeberg PR. I have included a changelog compared to 1.1 below:
-
GET /userlimitinput parameter now defaults to 20. Previously default was 50 for posts and 10 for comments.
-
PUT /user/subscribe- added
subscribedfield to response to mirror similar pattern elsewhere, like/user/block
- added
-
PUT /user/save_user_settings- Documented some input fields that were previously undocumented in the swagger
- Documented the response
-
POST /user/set_flair- modified so that either omitting the
flair_textfield or setting it tonullwill remove existing flair
- modified so that either omitting the
-
GET /user/notificationsstatusinput field options renamed to one ofUnread,Read, orAllunreadfield replacesnew_notificationsin thecountsfieldreadfield replacesread_notificationsin thecountsfieldtotalfield replacestotal_notificationsin thecountsfield- I had to redefine the schema for the
itemsfield because the auto-documenting library we are using doesn’t support the OpenAPIanyOffeature. So, this field is now a list of a generic notification schema. I have documented which types of notifications the optional fields are returned for. usernamefield replacesusersince it is just a string rather than a whole schema
-
I added the
about_htmlfield to a couple schema (/siteand/user/save_user_settingsresponses both have it) as the html version of a user’saboutin case it would be easier for you to use the html version of a user’s bio instead of markdown.

