1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-05 19:30:58 +00:00
forgejo/routers/api/v1
BtbN 9828aca733 feat: github compatability for removing label from issue API (#8831)
On GitHub, `DELETE /repos/{owner}/{repo}/issues/{index}/labels/{id}` takes the label name, not id:

https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue

This breaks workflows and actions that interact with labels and delete them.
It also makes the API quite difficult to use, always having to query the ID first before deleting a label from an issue, potentially with two API calls, because it could be a repo or org label.

For backwards compatibility, if no label with the given name is found, and the name converts to an int without error, it'll still be looked up by ID.

The API on GitHub also does not return 204, but 200, with the label it just removed from the issue as content. So this is returned when `application/vnd.github+json` is set in the `Accept` request header.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8831
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: BtbN <btbn@btbn.de>
Co-committed-by: BtbN <btbn@btbn.de>
2025-08-30 03:29:23 +02:00
..
activitypub Sent user activities to distant federated server (#8792) 2025-08-06 16:16:13 +02:00
admin chore(api): update swagger method descripitons (#8728) 2025-07-30 18:08:28 +02:00
misc feat(sec): Add SSH signing support for instances (#6897) 2025-04-11 13:25:35 +00:00
notify chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
org chore(api): update swagger method descripitons (#8728) 2025-07-30 18:08:28 +02:00
packages chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo feat: github compatability for removing label from issue API (#8831) 2025-08-30 03:29:23 +02:00
settings chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
shared chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
swagger Sent user activities to distant federated server (#8792) 2025-08-06 16:16:13 +02:00
user chore(api): update swagger method descripitons (#8728) 2025-07-30 18:08:28 +02:00
utils feat: add sort parameter for users/search api endpoint (#8594) 2025-07-24 22:40:27 +02:00
api.go feat: github compatability for removing label from issue API (#8831) 2025-08-30 03:29:23 +02:00