Last modified: 2012-12-13 11:18:14 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 T40521, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38521 - API: wbgetitems should only return tokens when requested
API: wbgetitems should only return tokens when requested
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
http://wikidata-test-repo.wikimedia.d...
storypoints: 3
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-20 14:40 UTC by merl
Modified: 2012-12-13 11:18 UTC (History)
4 users (show)

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


Attachments

Description merl 2012-07-20 14:40:57 UTC
http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetitems&sites=dewiki&titles=Helium&prop=sitelinks

also returns descriptions, labels and a token altough this was not requested by the api query above.

The response would only be correct if i would send this request:

http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetitems&sites=dewiki&titles=Helium&prop=sitelinks|aliaseslabels|descriptions&gettoken

This creates unneeded database load and tcp traffic.
Comment 1 jeblad 2012-07-23 10:21:21 UTC
From the API documentation

props               - The names of the properties to get back from each item.
                        Will be further filtered by any languages given.
                        Values (separate with '|'): sitelinks, aliases, labels, descriptions
                        Default: sitelinks|aliases|labels|descriptions

Note that there are defaults and that those will be delivered unless overridden. Always specify what information you want back, otherwise the items will be quite large. Especially use the language parameter to limit the number of entries for labels and descriptions if you can.

The amount of information will not generate additional database load as they are all read from the item itself, which is stored as a serialized object on the page.

The token should not be generated unless requested, that is an error.
Comment 2 Umherirrender 2012-07-23 16:11:10 UTC
It is better, if you not using gettoken, see bug 35993
Comment 3 jeblad 2012-08-15 08:45:47 UTC
https://gerrit.wikimedia.org/r/#/c/16282

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


Navigation
Links