Page MenuHomePhabricator

Clean up ApiResult and ApiFormatXml, create new formatversion
Closed, ResolvedPublic

Description

ApiResult has a weird mess of functions that manipulate the internal data structure and data that manipulates an array that will later be added to the internal data structure, with some of the latter being dynamic for little good reason.

And then clean up of uses of all the deprecated functions, and ideally some unit tests to make sure things are more-or-less working right as far as the BC transformations and so on.

Since it all needs changing anyway, at the same time let's do the "Make ApiFormatXml not throw errors when it's missing its metadata" and "Create new formatversion for format=json" items from the API work planning document.

Related Objects

Event Timeline

Anomie claimed this task.
Anomie raised the priority of this task from to Medium.
Anomie updated the task description. (Show Details)
Anomie added a project: MediaWiki-Core-Team.
Anomie moved this task to In Dev/Progress on the MediaWiki-Core-Team board.
Anomie changed Security from none to None.
Anomie added a subscriber: Anomie.
Anomie renamed this task from Clean up ApiResult to Clean up ApiResult and ApiFormatXml, create format=json2.Dec 23 2014, 6:30 PM
Anomie updated the task description. (Show Details)

Change 182858 had a related patch set uploaded (by Anomie):
API: Overhaul ApiResult, make format=xml not throw, and add format=json2

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

Patch-For-Review

Necessary extension changes are here

I'm not sure how I feel about &format=json2. I find the name pretty misleading. Compare with HTML5... that's a real concept; the same can't be said of JSON2 and I think this will cause confusion.

Would versioning the API (e.g., &apiversion=2) be better?

Versioning the whole API, no. Especially since this isn't.

But adding a "version" parameter of sorts to format=json (and maybe format=php), maybe.

Anomie renamed this task from Clean up ApiResult and ApiFormatXml, create format=json2 to Clean up ApiResult and ApiFormatXml, create new formatversion.Jan 28 2015, 4:33 AM
Anomie updated the task description. (Show Details)
ksmith changed the task status from Open to Stalled.Mar 20 2015, 11:15 PM

Change 182858 merged by jenkins-bot:
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion

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

Change 205707 had a related patch set uploaded (by Legoktm):
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion

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

Change 205707 merged by jenkins-bot:
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion

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