Page MenuHomePhabricator

REST: expose a machine readable directory of available API modules
Closed, ResolvedPublic

Description

With the introduction of REST modules (T362480), there is no longer a single API spec that covers all endpoints. Instead, each component defines its own spec. For the purpose of discoverability, it seems useful to have a machine readable listing of all available modules on a wiki, including modules defined by MW core, by extensions, and potentially also modules provided by external services such as Page Content Service (PCS). MediaWiki will have to know about this list anyway, for the benefit of T325558.

There seems to be no standard for this kind of directory, so we are free to (force to) come up with a format that suites our needs.

Details

Related Changes in Gerrit:

Event Timeline

Change #1028487 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] WIP: REST: Emit machine readable directory of available modules

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

BPirkle renamed this task from REST: expose a machiene readable directory of available API modules to REST: expose a machine readable directory of available API modules.May 24 2024, 7:06 PM
daniel raised the priority of this task from Low to Medium.May 30 2024, 2:48 PM
daniel moved this task from Incoming (Needs Triage) to Backlog on the MW-Interfaces-Team board.
daniel changed the task status from Open to In Progress.May 30 2024, 3:42 PM
daniel lowered the priority of this task from Medium to Low.
daniel moved this task from Backlog to In Progress on the MW-Interfaces-Team board.

After looking more closely, I'm of the opinion that we should start with something very minimalist, at least as lean as the Google approach, and maybe a lot leaner.

I'd be agreeable to just a bit of site metadata and an array of module objects, where each module object contains only one two fields:

  1. name: (in the case of a core or extension module, this would be the module id)
  2. base url
  3. spec url

Starting lean, and under a /v0/specs url (or maybe a specs.v0 module) would give us an opportunity to address the most important need, machine-readable discovery of modules, while we learn what other information callers might actually care about.

Change #1028487 merged by jenkins-bot:

[mediawiki/core@master] REST: Introduce discovery endpoint

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

This is implemented now, though it's still not enabled in production.