Last modified: 2012-12-09 16:01:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44888, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42888 - Some API queries uses asterisk as object key
Some API queries uses asterisk as object key
Status: RESOLVED DUPLICATE of bug 31629
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-08 22:46 UTC by Waldir
Modified: 2012-12-09 16:01 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Waldir 2012-12-08 22:46:26 UTC
For example http://en.wikipedia.org/w/api.php?action=query&prop=revisions&format=jsonfm&rvprop=content&generator=random

Bug 21922 has another example

the * key of the revisions object makes it impossible to use the dot notation to access its properties from Javascript, e.g. revisions.* -- one has to resort to ["*"] instead.

This is not a big deal, of course, but using a different character would make both access methods available. For example, $ or _ ( see http://stackoverflow.com/questions/1661197/valid-characters-for-javascript-variable-names ) are valid variable names in javascript, and they would enable usage of revisions.$ instead of revisions['*']
Comment 1 Jarry1250 2012-12-08 22:48:42 UTC
Well, it would remove the similarity with the XML output, which is presumably why we have * in the first place. Also, this would be a breaking change...?
Comment 2 Brad Jorsch 2012-12-09 03:59:54 UTC
I'm inclined to WONTFIX this, as it's trivial to work around, would be a major breaking change to the API, and even the reporter states it "is not a big deal". 

Is there any advantage here besides preferring to use dot notation instead of bracket notation, that would be worth a major breaking change to the API?
Comment 3 Umherirrender 2012-12-09 10:41:22 UTC
See also bug 31629
Comment 4 Waldir 2012-12-09 16:01:22 UTC
(In reply to comment #3)
> See also bug 31629

Thanks, Umherirrender. This seems to be a dupe of that bug, so I'll continue discussion there.

*** This bug has been marked as a duplicate of bug 31629 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links