Page MenuHomePhabricator

Create Wikibase v1 REST API Module
Closed, ResolvedPublic8 Estimated Story Points

Description

Description

The first step of making the Wikibase documentation more reasonable and consistent with our other API structures is to create an API module. API module creation will allow us to have flexibility with how and where the reference documentation is displayed. Specifically, we can contain and eventually hide the endpoints from the flat list to make it easier to navigate while opting to display the higher quality externally managed spec within the Sandbox.

Conditions of acceptance

  • Create a REST API module for the Wikibase extension
  • All routes under wikibase/v1 should be included in that module
  • Do not surface this module in the REST Sandbox; it should be hidden by default

EDIT: we will surface the sandbox for parity with what's there now since since can't yet use the open-api.json spec provided by one of the endpoints until T425451 is dealt with.
ANOTHER EDIT: we changed course and will not surface this module in the REST Sandbox at this time.

Event Timeline

BPirkle triaged this task as Medium priority.Apr 6 2026, 6:54 PM
BPirkle moved this task from Incoming (Needs Triage) to Backlog on the MW-Interfaces-Team board.
aaron set the point value for this task to 8.

Change #1273300 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/extensions/Wikibase@master] [DNM] Introduce a REST module for /wikibase/v1 endpoints

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

Next steps here: Confirm LoE for self-service security review so we can decide if the SwaggerUI upgrade is possible. @Mooeypoo & @aaron will lead the conversation and report back on options. The main issue is that we are confident we will move away from SwaggerUI within a few months, so we should not invest weeks of effort to go through a security review. If the self service process takes a day or two, then we can do it; if it will be weeks or months of turnaround time, then we will not be able to ingest the existing Wikidata spec and will need to discuss other options.

Change #1276814 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[operations/mediawiki-config@master] Add wikibase.v1 module to the sandbox were it is present

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

Change #1278799 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] rest: use getRoutePath() for metrics in Module

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

aaron changed the task status from Open to In Progress.Apr 29 2026, 3:28 PM

Change #1276814 merged by jenkins-bot:

[operations/mediawiki-config@master] Add wikibase.v1 module to the sandbox were it is present

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

Mentioned in SAL (#wikimedia-operations) [2026-05-05T20:11:59Z] <arlolra@deploy1003> Started scap sync-world: Backport for [[gerrit:1283082|Enable WikiLove on shwiki (T424891)]], [[gerrit:1276814|Add wikibase.v1 module to the sandbox were it is present (T422403)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-05T20:13:56Z] <arlolra@deploy1003> aaron, neriah, arlolra: Backport for [[gerrit:1283082|Enable WikiLove on shwiki (T424891)]], [[gerrit:1276814|Add wikibase.v1 module to the sandbox were it is present (T422403)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-05T20:22:30Z] <arlolra@deploy1003> Finished scap sync-world: Backport for [[gerrit:1283082|Enable WikiLove on shwiki (T424891)]], [[gerrit:1276814|Add wikibase.v1 module to the sandbox were it is present (T422403)]] (duration: 10m 30s)

The task description still says we're hiding this from the REST Sandbox. To confirm, given the swagger ui upgrade challenges, we decided to alter the original plan, will be publishing the spec in the REST Sandbox, and should update the task description, right? I note that the config change for publishing the generated spec to the REST Sandbox once the module is present is merged.

The change to create the REST module looks good pending tests passing (the one failure seems unrelated to the change - CI flakiness?)

Change #1278799 merged by jenkins-bot:

[mediawiki/core@master] rest: use getRoutePath() for metrics in Module

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

Update: we originally intended to not show this module in the REST Sandbox, and then decided to. After further consideration, we have returned to the original decision, and will not be showing this module in the REST Sandbox at this time.

The config change to show the module was merged, but the change to create module itself was never merged, so these is no visible effect from this decision. We'll revert the config change before merging the module change.

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

[operations/mediawiki-config@master] Revert "Add wikibase.v1 module to the sandbox were it is present"

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

Change #1286981 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert "Add wikibase.v1 module to the sandbox were it is present"

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

Mentioned in SAL (#wikimedia-operations) [2026-05-13T20:06:59Z] <cjming@deploy1003> Started scap sync-world: Backport for [[gerrit:rMW12869819abdd|Revert "Add wikibase.v1 module to the sandbox were it is present" (T422403)]]

Mentioned in SAL (#wikimedia-operations) [2026-05-13T20:09:01Z] <cjming@deploy1003> bpirkle, cjming: Backport for [[gerrit:rMW12869819abdd|Revert "Add wikibase.v1 module to the sandbox were it is present" (T422403)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-05-13T20:13:46Z] <cjming@deploy1003> Finished scap sync-world: Backport for [[gerrit:rMW12869819abdd|Revert "Add wikibase.v1 module to the sandbox were it is present" (T422403)]] (duration: 06m 47s)

I think the patch for creating the module is ready to go in, and we have a +1.

Would anyone from WMDE like to take a look first? I wasn't sure who to tag as reviewer. @WMDE-leszek

Change #1273300 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Introduce a REST module for /wikibase/v1 endpoints

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