[GH-ISSUE #1984] Inconsistent APIs: tasks/all vs projects & labels returns null #6516

Closed
opened 2026-04-20 17:07:01 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @mrmattson on GitHub (Dec 14, 2025).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/1984

Description

Bottom-line: Highlighting the "get-all" type API calls aren't the same URL (/tasks/all vs /projects) and the empty response is [] for some and null for others.

Caveat: This is either beyond fix with 1.x.x API on RC3, or there's a bigger design choice I've not seen. Or maybe this is a feature request rather than a bug.

First, the "get all the tasks a user has access to" API utilizes all at the end (https://try.vikunja.io/api/v1/tasks/all) while other "get everything" APIs do not, such as projects (https://try.vikunja.io/api/v1/projects). This seems like an inconsistency.

Second, while working with the APIs, I noticed that requesting tasks using pagination parameters that are beyond the total number of tasks returns an empty array ([]). For example, 55 tasks exist and page 2 with 100 tasks per page is requested: empty array is returned. However, not so for the labels API.

For the labels API, if 55 labels exist and page 2 is requested with 100 labels per page is requested the API returns null. This is inconsistent with what I would expect based on the tasks API. The teams API also returns an empty array for this scenario.

For both items (/tasks/all and /labels --> null), the https://try.vikunja.io/api/v1/docs documentation doesn't specify the different forms of the results when there is nothing to be returned by the paginated results.

Finally, wonderful project, use this thing all the time. If all of this is beyond API freeze or whatever, close it out and move on. Thanks!

Vikunja Version

v1.0.0-rc3

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Please select

Screenshots

No response

Originally created by @mrmattson on GitHub (Dec 14, 2025). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/1984 ### Description Bottom-line: Highlighting the "get-all" type API calls aren't the same URL (`/tasks/all` vs `/projects`) and the empty response is `[]` for some and `null` for others. Caveat: This is either beyond fix with 1.x.x API on RC3, or there's a bigger design choice I've not seen. Or maybe this is a feature request rather than a bug. First, the "get all the tasks a user has access to" API utilizes `all` at the end (`https://try.vikunja.io/api/v1/tasks/all`) while other "get everything" APIs do not, such as projects (`https://try.vikunja.io/api/v1/projects`). This seems like an inconsistency. Second, while working with the APIs, I noticed that requesting tasks using pagination parameters that are beyond the total number of tasks returns an empty array (`[]`). For example, 55 tasks exist and page 2 with 100 tasks per page is requested: empty array is returned. However, not so for the labels API. For the labels API, if 55 labels exist and page 2 is requested with 100 labels per page is requested the API returns `null`. This is inconsistent with what I would expect based on the tasks API. The `teams` API also returns an empty array for this scenario. For both items (`/tasks/all` and `/labels` --> `null`), the <https://try.vikunja.io/api/v1/docs> documentation doesn't specify the different forms of the results when there is nothing to be returned by the paginated results. Finally, wonderful project, use this thing all the time. If all of this is beyond API freeze or whatever, close it out and move on. Thanks! ### Vikunja Version v1.0.0-rc3 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Please select ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Dec 15, 2025):

The inconsistency for /tasks/all has existed for a while and was a leftover of when we had another route at /tasks that collided with the /tasks/all endpoint. I've opened https://github.com/go-vikunja/vikunja/pull/1988 to move that route to just /tasks.

The labels (and other endpoints) inconsistency has been fixed as well in the linked PR.

<!-- gh-comment-id:3656238041 --> @kolaente commented on GitHub (Dec 15, 2025): The inconsistency for `/tasks/all` has existed for a while and was a leftover of when we had another route at `/tasks` that collided with the `/tasks/all` endpoint. I've opened https://github.com/go-vikunja/vikunja/pull/1988 to move that route to just `/tasks`. The labels (and other endpoints) inconsistency has been fixed as well in the linked PR.
Author
Owner

@mrmattson commented on GitHub (Dec 15, 2025):

Wonderful, thanks for the explanation!

<!-- gh-comment-id:3656260660 --> @mrmattson commented on GitHub (Dec 15, 2025): Wonderful, thanks for the explanation!
Author
Owner

@vikunja-bot-app[bot] commented on GitHub (Dec 15, 2025):

This issue has been fixed in #1988, please check with the next unstable build (should be ready for deployment in ~30min, also on the demo).

<!-- gh-comment-id:3656292414 --> @vikunja-bot-app[bot] commented on GitHub (Dec 15, 2025): This issue has been fixed in #1988, please check with the next unstable build (should be ready for deployment in ~30min, also on [the demo](https://try.vikunja.io)).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#6516