Page MenuHomePhabricator

Create Search REST API module
Open, MediumPublic

Description

Description

The MediaWiki Interfaces team recently introduced a new pattern for defining self-contained REST API Modules within the MediaWiki REST framework for REST APIs. REST API modules represent collections of related endpoints, which can be independently managed from other REST API modules. They create controlled flexibility through federated ownership, while also ensuring that related capabilities are self-contained, can be independently versioned, and can share object definitions and the like. They are therefore particularly well-suited for extension REST API definitions, which are already self contained.

The search endpoints within the MediaWiki REST API represent a set of functionality owned by the search team. To ensure that they can be versioned and managed independently from the rest of MedidaWiki, it makes sense to separate them out into a dedicated module.

Conditions of acceptance

  • REST API module is created
    • See: https://www.mediawiki.org/wiki/API:REST_API/Extensions <-- //The process may be slightly different, since this is moving content out of MediaWiki Core instead of an extension; MediaWiki Interfaces can help with any updated instructions and/or related framework changes that need to be implemented.
  • A high(er) quality spec is generated for REST API:
    • See: https://www.mediawiki.org/wiki/Documentation/API_documentation/Reference
    • A high level module description is created, with a link to the REST documentation.
    • Endpoints all have short descriptions and summaries
    • Parameter descriptions are helpful to human readers
    • Schemas are defined, with useful descriptions for all properties
    • Examples are created where needed
  • REST API module is available in the REST Sandbox dropdown
  • REST endpoints are removed from the "flat" MediaWiki definition

Helpful documentation

NOTE: We do not yet expect full compliance with the "required" fields in the OAD style guide. These guidelines were created to support the related linter work, but are not yet enforced.

Implementation details

This may be the first time we are breaking a part of MediaWiki Core into a module, instead of an extension. There may be some kinks to figure out because of that.

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone

Event Timeline

This may be the first time we are breaking a part of MediaWiki Core into a module, instead of an extension. There may be some kinks to figure out because of that.

Note that this is not the first REST module in core - we already have site.v1 and specs.v0, so we're confident that the REST module system itself works properly. But (depending on what order this is done relative to similar tasks) it might be the first time we've moved endpoints from being "flat routes" into a REST module. In other words, the new thing is the transition, not the thing we're transitioning to.