Page MenuHomePhabricator

MediaWiki REST API documentation standardization
Closed, ResolvedPublic

Description

This task captures work required to bring the MediaWiki REST API documentation into alignment with the standard documentation patterns defined as part of FY25/26 API and documentation strategy. It excludes work related to OpenAPI-based reference documentation, which is tracked separately (see parent and related tasks).

Baseline metrics and other content analysis details for this API doc collection are at: https://www.mediawiki.org/wiki/Wikimedia_Technical_Documentation_Team/API_documentation_strategy/Gaps#MediaWiki_REST_API

IA requirements:

  • The API landing page supports navigation to each of the types of content required by the guidelines.
  • The sequencing of information in the navigation menu follows the sequence outlined in the guidelines.
  • The overview information on the landing page previously included some how-to content mixed in with access policy info. The Client Identification and Authorization info in this section was revised and split into a separate guide. It was previously confusing that there are two sections about authorization (more about this below).
  • Before: The use of a nav menu to link to important subpages, but putting all overview and quick-start content on the landing page is creating a doc UX that feels somewhat unbalanced; I think it would be better to reduce the prose on the landing page and give more prominence to links to the very important subpages, and reconsider whether some of the content like the "Conditional requests" page should be integrated into other content. It's also unclear how prominent the Extension and CORS content should be, but right now all the links seem to have equal prominence, which I don't think reflects their usage or importance.
  • After: The landing page is primarily navigation-focused but retains come key information in prose; quick start content is moved to getting started guide. Nav menu updated to reflect the same content structure as the landing page. Conditional requests integrated into Getting started guide.
  • Each content page (including sandbox/explorer UI) supports navigation back to the API's landing page.
  • Before: https://www.mediawiki.org/wiki/Template:REST_API is not on all pages in the collection: https://www.mediawiki.org/wiki/API:REST_API/Reference uses a different navigation box.
  • After: https://www.mediawiki.org/wiki/Template:REST_API is on all possible pages, and API:REST_API/Reference no longer has a separate nav section of its own.

Content requirements:

  • The API doc collection has a landing page that includes each piece of content specified in the guidelines.
    • Before: Landing page includes all overview content and links to tutorials and reference. The page could benefit from being refactored and the overview content expanded.
  • After: Overview content expanded, quick start and access / usage + stability policy content moved to new subpages.
  • The API overview section or page covers the minimum required content.
  • Done: Expand overview content to cover more of this APIs features, and why one would use it instead of the other APIs (user question).
  • Done: Address the confusing presence of two sections on authorization (see more below).
  • The API doc collection includes a quick start tutorial.
  • The API doc collection includes an authentication how-to guide.
  • Done: Addressed the confusion of having two sections: one for "Permissions and Authorization" and one for "Authorization". The latter previously linked to https://www.mediawiki.org/wiki/Special:MyLanguage/OAuth/For_Developers. We should explore if there's a way to avoid asking the reader to read the entire Oauth guide for developers, and instead provide the relevant info within a small authorization how-to guide. T349790 tracks work to improve the UX of the OAuth documentation in general.
  • The API doc collection includes recipes or real-world examples for common tasks
  • The API doc collection includes a changelog.
  • Done: @KBach created https://www.mediawiki.org/wiki/API:REST_API/Changelog and it is linked from the landing page and stability policy section.
  • The API's documentation content follows the Wikimedia documentation style guide.
  • Done: Revise copy to use active voice and action-oriented headers/titles wherever possible

Event Timeline

TBurmeister renamed this task from MediaWiki REST API documentatin standardization to MediaWiki REST API documentation standardization.Sep 29 2025, 8:06 PM
TBurmeister triaged this task as Low priority.
TBurmeister changed the task status from Open to In Progress.Oct 8 2025, 2:26 PM
TBurmeister claimed this task.

I created a draft, example version of the MediaWiki REST API docs that implements the new doc patterns:

The only new subpage I had to create to align the existing content with the recommended structure was:

All the existing content in the real MW REST API docs is covered in the draft; there was a fair amout of duplication that enabled me to remove and streamline the content. I didn't do anything with the API reference page, but also didn't link to a Sandbox since this draft is based on information resources that exist right now, not those that are still in development.

I documented some of the issues I uncovered during this process on the Talk pages for the doc patterns:

We should discuss these issues and iterate on the doc patterns accordingly.

The biggest issue that we don't have control over, and I think will cause problems across doc collections, is the issue of policy docs (API usage guidelines, robot policy, content attribution guidelines). See the Talk page notes for my concerns about that.

I iterated on the landing page design:

I've requested feedback on the design from the working group and am open to feedback on this task as well; some specific questions are:

  1. How do you feel about the buttons and the boxes? Is it too many different UI elements on the page?
  2. How do you feel about linking to the sandbox from a button ("try it out") and again from within a box ("API reference")
  3. Is it weird / unhelpful to link to the overview page twice as well? ("learn more" button and again from within a box ("overview and policies")?
  4. Do you think the subpages need a nav menu, or is the breadcrumb trail enough? (this collection is very small so it might not need a nav menu on subpages, but I expect other larger doc collections will need that)

After discussing the above issues, if we feel good about where this example is at, I'll start talking with the MWI team about implementing it for the live docs, and also about applying the same pattern to another API owned by the team.

Based on feedback on the MW REST API doc redesign, I iterated and have adjusted the landing page structure and content: https://www.mediawiki.org/wiki/User:TBurmeister_(WMF)/Sandbox/REST_API.
This most recent version has the following improvements:

  • Landing page content structure reflects standard doc types (which are consistent across all collections of tech docs)
  • Page and content structure can be extended to accommodate larger doc collections, while still staying consistent
  • Landing page now presents links consistently regardless of which wiki they point to (rather than using box title links for pages on the same wiki, but having to use box content links for pages elsewhere)
  • It doesn't use box header links which are kind of a UX antipattern to begin with :-)
  • Groups together standard "Quick start" content (overview + quick start tutorial), and moves larger pieces of introductory prose onto the Overview page. This is both an improvement for streamlining the landing page UX, and a more consistent way of grouping the information overall.

Currently continuting to talk with stakeholders to align on this design, with a tentative plan to implement it for the real docs next week if possible.

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

[mediawiki/core@master] REST: enable deep linking in swagger ui for the REST Sandbox

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

The patch I just uploaded allows for links that automatically scroll to and expand a particular endpoint in the REST Sandbox. I attached it to this task in case it is useful for links from the on-wiki documentation to the REST Sandbox.

For example, a link like this:
http://en.wikipedia.org/wiki/Special%3ARestSandbox#/default/get_v1_search_title

would open the REST Sandbox with the search by title endpoint expanded and visible. These links can be easily generated (once the patch is merged) by right-clicking on the link path in the sandbox and choosing "Copy Link Address" from the popup (or "Copy Link" or whatever your particular browse calls that option).

Change #1201700 merged by jenkins-bot:

[mediawiki/core@master] REST: enable deep linking in swagger ui for the REST Sandbox

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

I've iterated through all the open questions on the draft revision of the MW REST API docs at https://www.mediawiki.org/wiki/User:TBurmeister_(WMF)/Sandbox/REST_API. I'm now going to post on the Talk page and invite feedback from anyone else who might care to comment, then I'll plan to implement these changes the first week of December.

TBurmeister updated the task description. (Show Details)