Page MenuHomePhabricator

Reading List REST Interface: create a way to use ReadingListRepository within REST API handlers
Closed, ResolvedPublic

Description

API Platform is preparing to replace the existing combination of RESTBase + Action API endpoints with MediaWiki REST API endpoints.

The Reading Lists extension uses a ReadingListRepository class to manage database access. The extension's Action API endpoints use ApiTrait to conveniently access ReadingListRepository within the Action API modules.

It would be helpful to have a similar solution for REST API handlers. Those handlers can't use ApiTrait directly, because it includes certain things specific to Action API (for example, it refers to ApiBase). And per group discussion, we don't want to modify existing, working code.

So, consider and implement a solution to serve a similar purpose for REST API handlers. That might be a trait, or a base handler class that the various REST endpoints to be created in the extension can derive from, or some other solution.

See the associated Miro board for endpoint map.
See parent task T336693: Re-implement reading lists REST interface outside RESTBase for context and details.