When no items are available for the selected filters, the Wallabag API returns a 404 status code with the following body:
{
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "An error occurred",
"status": 404,
"detail": "Not Found"
}
The Sako implementation returns a 200 status code with the following body:
{
"page": 3,
"limit": 5,
"pages": 2,
"total": 9,
"_links": {
"self": {
"href": "/api/entries?detail=metadata&order=desc&page=3&perPage=5&sort=created"
},
"first": {
"href": "/api/entries?detail=metadata&order=desc&page=1&perPage=5&sort=created"
},
"last": {
"href": "/api/entries?detail=metadata&order=desc&page=2&perPage=5&sort=created"
},
"next": {
"href": "/api/entries?detail=metadata&order=desc&page=2&perPage=5&sort=created"
}
},
"_embedded": {
"items": null
}
}
Some applications, like the Koreader Wallabag plugin, expect a 404 status response in this situation and crash when the items are null.
While the API could be better designed, it would be useful to keep the Sako API as close as possible to Wallabag's behavior. What do you think?
Thank you for your work!
Hi ~ruben,
Thanks for the report (and the patches). I'll have a look at those shortly (by the end of the week).
Apologies for the belated answer.
-s