https://bugzilla.wikimedia.org/show_bug.cgi?id=31629
Web browser: ---
Bug #: 31629
Summary: API uses weird * (star) key for the content property
in JSON and PHP serialized formats
Product: MediaWiki
Version: (wikimedia-deployment)
Platform: All
OS/Version: All
Status: NEW
Severity: trivial
Priority: Unprioritized
Component: API
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Classification: Unclassified
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Hello+World&rvlimit=1&rvprop=content%7Ctimestamp&format=json
returns:
{"timestamp":"2011-10-11T23:54:33Z","*":"A '''\"Hello world\" program''' is a
[[computer program]] that prints out \"Hello world\" on...."}
for the query.pages[0].page.revisions[0]
Why is it assigning the content to a key called "*"?? This is unfortunate since
* is an operator in Javascript, so you can't use the normal
query.pages[0].page.revisions[0].*, and instead have to use
query.pages[0].page.revisions[0]['*']. Why don't we assign it to a key called
"rev" like in the XML version, or better yet "content" (the name of the
property)? All of the other properties have regular key names so why not the
content? Otherwise we are just giving JS developers a headache.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l