Page MenuHomePhabricator

Reading List REST Interface: GET lists endpoint
Closed, ResolvedPublic

Description

Create a REST handler and any other necessary associated code (extension.json entry, helper classes, etc.) for the GET lists endpoint.

  • endpoint implemented
  • tests created
  • tests pass

Endpoint summary:
Get all lists of the current user.

Endpoint description:
Returns metadata describing the lists of the current user. Might be truncated and include a continuation token.
Request must be authenticated with a MediaWiki session cookie.
Stability: unstable

Associated RESTBase code
lists.yaml (spec+forwarding)
lists.js (tests)

Associated Action API code
ApiQueryReadingLists
ApiQueryReadingListsTest

Parameters:

namesourcerequiredtypeexampledefaultpossible valuesdescription
nextquerynostringN/AN/AContinuation parameter from previous request
sortquerynostringupdatedname, updatedSort order: name: by name, ascending; updated: by last modification date, descending.

Error Response

#/components/schemas/problem per API.md and draft-nottingham-http-problem

Success Response

valuetypedescription
listsarray: list_read
nextstringContinuation token
continue-fromstring (date-time)Timestamp to sync from, to be used with the GET /lists/changes/since/{date} endpoint.

Response Headers

This endpoints has additional response headers specified in the RESTBase code:

headers:
  content-type: application/json; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Lists/0.1"
  cache-control: max-age=0, s-maxage=0

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
BPirkle renamed this task from Reading List REST Interface: create lists GET endpoint to Reading List REST Interface: GET lists endpoint.Nov 14 2023, 2:57 AM
BPirkle updated the task description. (Show Details)

Change 983241 had a related patch set uploaded (by BPirkle; author: BPirkle):

[mediawiki/extensions/ReadingLists@master] REST Handlers for managing reading lists

https://gerrit.wikimedia.org/r/983241

The underlying Action API endpoint included the ability to retrieve an individual list by id. While the RESTBase interface did not provide this (and it therefore is not technically needed for compatibility) it was trivial to add and seems reasonable from a CRUD standpoint. And not having it might be seen as a barrier to removing the Action API endpoints (and therefore having to continue maintenance on code in two different API infrastructures). So I also added a lists/{id} endpoint.

Change 983241 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] REST Handlers for managing reading lists

https://gerrit.wikimedia.org/r/983241

Added the following parameters that were previously exposed by the underlying Action API endpoint, but not by RESTBase:

namesourcerequiredtypeexampledefaultpossible valuesdescription
dirquerynostringdescendingascendingascending, descendingsort direction
limitquerynointeger5101..10Maximum number of values to return