Page MenuHomePhabricator

Clean up core API data formats for new formatversion
Closed, ResolvedPublic

Description

Take advantage of the new ApiResult metadata to do the following:

  • Change booleans to actual booleans, instead of present-as-empty-string for true and absent for false.
  • Change {"key":{"*":"value"}} to {"key":"value"}
  • Change things that are really key-value pairs to kvp: [{"name":"key1","*":"value1"},{"name":"key2","*":"value2"}]{"key1":"value1","key2":"value2"}
    • Note this doesn't apply if there are more than two properties, although we might still change it to an assoc instead of an array in that case.
  • Change query's "pages" output to an 'BCarray' so it comes out as an array in the new format.
  • Resolve T12887 by setting META_TYPE='assoc' where needed.

Event Timeline

Anomie created this task.Jan 16 2015, 7:50 PM
Anomie claimed this task.
Anomie raised the priority of this task from to Low.
Anomie updated the task description. (Show Details)
Anomie added a subscriber: Anomie.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 16 2015, 7:50 PM
Anomie renamed this task from Clean up core API data formats for format=json2 to Clean up core API data formats for new formatversion.Jan 28 2015, 4:32 AM
Anomie updated the task description. (Show Details)
Anomie set Security to None.
gerritbot added a subscriber: gerritbot.

Change 191103 had a related patch set uploaded (by Anomie):
Change API result data structure to be cleaner in new formats

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

Patch-For-Review

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Feb 19 2015, 6:05 PM
daniel added a subscriber: daniel.Apr 17 2015, 10:16 AM

I just merged @Anomie's patch that removes usage of deprecated ApiResult methods from Wikibase, see I847a4a5a1c9

Change 191103 merged by jenkins-bot:
Change API result data structure to be cleaner in new formats

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

Anomie closed this task as Resolved.Apr 21 2015, 2:00 PM

Change 205714 had a related patch set uploaded (by Legoktm):
Change API result data structure to be cleaner in new formats

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

Change 205714 merged by jenkins-bot:
Change API result data structure to be cleaner in new formats

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