[Mediawiki-api] [Mediawiki-api-announce] BREAKING CHANGE: list={backlinks, embeddedin, imageusage} no longer return arrays with pageIDs as keys (was: Inconstisent [sic] formatting of results in JSON)

Roan Kattouw roan.kattouw at home.nl
Tue Aug 19 15:26:03 UTC 2008


This change only affects clients using the JSON, PHP, WDDX, PHP, TXT and 
DBG formats. If you're using the XML or YAML formats, nothing will 
change for you.

The list=backlinks, list=embeddedin and list=imageusage used to return 
arrays with pageIDs as keys, duplicating information (those arrays also 
contain the pageID). An example (in JSON):

{
	"query": {
		"backlinks": {
			"1024": {
				"pageid": "1024",
				"ns": 1,
				"title": "Talk:Anarcho-capitalism"
			},
			"1236": {
				"pageid": "1236",
				"ns": 1,
				"title": "Talk:Algorithm"
			}
		}
	}
}


After a complaint [1] about this behavior, it was changed in r39645 [2]. 
Like all other list= modules, backlinks and friends now return arrays 
with 0, 1, 2, etc. as keys. In JSON this looks like:

{
	"query": {
		"backlinks": [
			{
				"pageid": "1024",
				"ns": 1,
				"title": "Talk:Anarcho-capitalism"
			},
			{
				"pageid": "1236",
				"ns": 1,
				"title": "Talk:Algorithm"
			}
		]
	}
}

Roan Kattouw (Catrope)

[1] 
http://lists.wikimedia.org/pipermail/mediawiki-api/2008-August/000657.html
[2] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=39645


_______________________________________________
Mediawiki-api-announce mailing list
Mediawiki-api-announce at lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce



More information about the Mediawiki-api mailing list