Page MenuHomePhabricator

Add WikibaseClient API to format references
Closed, ResolvedPublic

Description

The API should initially not be available in production; it could be hidden behind the general “is bridge enabled” setting or behind a specific setting for this API. (In the latter case, don’t forget to enable the API in WikibaseClient.ci.php.)

Deserializes the reference JSON from the request parameters, sends it to the formatting service, parses the resulting Wikitext into HTML (compare WikitextContent::fillParserOutput()), returns that.

Consider adding integration tests for this API.

Event Timeline

Let's sleep on and discuss the HTTP method & Cache-Control behavior of this monster.
One thing that has been bugging me. /cc @Lucas_Werkmeister_WMDE @Michael

Change 580370 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] WIP: Add ApiFormatReference

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

Change 580930 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Make WikibaseClient extension load handler testable

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

I looked a bit more into the integration tests, but it’s not clear to me whether MediaWiki’s overall integration test framework is mature enough for this yet. I left two questions on the wiki talk page; in the meantime, I’d say that shouldn’t block this task.

Change 580930 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Make WikibaseClient extension load handler testable

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

Change 580370 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add ApiFormatReference

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