Page MenuHomePhabricator

Add Core REST API examples to the Examples extension
Closed, ResolvedPublic

Description

The "Example" extension (https://www.mediawiki.org/wiki/Extension:Example) provides various examples of how to implement common features.

We also have an example Core REST API extension, which we used in writing documentation. It was created under T232508: Create REST API example extension. It currently lives under an individual developer's github at https://github.com/bpirkle/RestApiExample

Per comment on T232508: Create REST API example extension by @Aklapper , it would be a good idea to add the Core REST API example to the Example extension.

As part of this, we should review the REST API example code against the current REST API conventions, as they have changed since the REST API example extension was created. Specifically, the current example does not conform to T232485: RFC: Core REST API namespace and version.

Once this is done, it should be mentioned on T225761: Document the REST API on mediawiki.org
Also, be aware of T156568: Review and update the Examples extension. In addition to giving some context, that page helps explain why the extension is documented at "Extension:Example" (singular) but its name in extension.json is "examples" (plural).

Event Timeline

It would also be useful to add additional examples, such as how to inject services, use a factory function, etc. Those things would be better done under their own tasks - I mention them here just to bring up the possibility.

Assuming this task is about MediaWiki-extensions-Examples, hence adding project tag so others can find this task when searching for tasks under that project or looking at that project workboard.

Change 544212 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/extensions/examples@master] Add REST Api Example to Example extension

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

Change 544212 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Add REST Api Example to Example extension

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

BPirkle triaged this task as Low priority.
Aklapper renamed this task from Add Core REST API examples to the Example extension to Add Core REST API examples to the Examples extension.Aug 23 2020, 1:36 PM