As part of our ongoing effort to make our api self-documenting and validating our api input/output, we have been working through the api endpoints one at a time to make things a bit more consistent and logical. I just finished doing this for our existing /community
endpoints and thought I would share the changelog here for awareness and feedback.
As of right now, these changes are only live on my instance and on our new, dedicated testing instance, crust.piefed.social. The self-documenting swagger for 1.2 (a WIP) can be found here.
1.2 Community Endpoints Changelog
PUT /community
- input parameter
community_id
properly documented (was previously erroneously documented asid
)
- input parameter
GET /community/list
- made
next_page
nullable if there is no next page - this change was backported to 1.1 already
- made
GET /community/moderate/bans
banned_by
replacesbannedBy
- transitioning everything to snake casebanned_user
replacesbannedUser
- transitioning everything to snake caseexpired_at
replacesexpiredAt
- transitioning everything to snake caseexpired_at
value ofnull
indicates a permanent banexpired_at
only returned if ban has expiredexpires_at
field added, only returned if ban is still in effectexpires_at
value ofnull
indicates permanent ban
PUT /community/moderate/unban
- same field name changes as above (snake_case instead of camelCase)
expired_at
is now set equal to current time if ban was found (indicating that it was just set to expired) and returned in standard timestamp format found elsewhere in the api (2025-06-07T02:29:07.980084Z
)
POST /community/moderate/ban
- Input:
expires_at
replacesexpiredAt
/expired_at
for inputexpires_at
uses standard timestamp format (2025-06-07T02:29:07.980084Z
)expires_at
is optionalexpires_at
is checked to make sure it is in the future, raises an exception if it is notpermanent
is new optional boolean field, supercedesexpires_at
if true- If
expires_at
is not provided andpermanent
is either false or not provided, then the ban is set to expire in one year
- Output:
- same field name changes as above (snake_case instead of camelCase)
expires_at
value ofnull
indicates permanent ban- standardize timestamp format of
expires_at
- only returns
expires_at
because it is a time in the future (does not returnexpired_at
)
- Input:
I actually kind of like it being a separate endpoint, so I don't mind that. One thing I thought about changing though, that I opted not to, was to make both
/ban
and/unban
the same request method. Right now/ban
is a post while/unban
is a put. I feel like they should both be the same. However, this felt like more of a bigger change than some field name tweaking, so I held off.