Last modified: 2012-09-16 07:16:47 UTC
Some API Modules like action=query offer parameters that take multiple values separated by '|'. But for a bot class, there is no way of knowing how many values are allowed and when sending more than the limit, there might be no way of knowing how many have been rejected in some cases. For example, you want to export revisions, you would call something like "api.php?action=query&revids=1|2|3|4|...|1000|1001&export", trying to request 1001 revisions to be exported, you would end up with only 50 or 500 (depending on whether you are a bot/sysop or whatever) without even knowing it. The only clue, the API will give you is a warning tag within the result. The information given there doesn't really provied machine friendly semantics though. Its just: <warnings> <query xml:space="preserve">Too many values supplied for parameter 'revids': the limit is 50</query> </warnings> There should be some more machine friendly information provided to check whether the request must be sent in little portions or not. Pretty much like the query-continue tag when running into result limitations.
You can use action=paraminfo for this information. In this example it is api.php?action=paraminfo&pagesetmodule=, which gives you <parameters> <param name="titles" description="A list of titles to work on" multi="" limit="50" lowlimit="50" highlimit="500" type="string" /> <param name="pageids" description="A list of page IDs to work on" multi="" limit="50" lowlimit="50" highlimit="500" type="integer" /> <param name="revids" description="A list of revision IDs to work on" multi="" limit="50" lowlimit="50" highlimit="500" type="integer" /> </parameters> You can see that revids = 50. Having a continue for the rest is also an idea.
Most of this bug is WORKSFORME then?
Have found this action=paraminfo in the meanwhile, so it's not impossible to handle. But still, would be a nice feature to have some continue tag. It would be more consistent since we have the same for the result limit and since we wouldn't have to do another query for it. Also, in theory, we had to do a action=paraminfo query for each qery module with such parameters because the limit could differ, so it would be much easier to work with a continue tag which is telling us the actual limit. The warning tag which is in the result right now in such a case really is kind of ridiculous in its current form.
(In reply to comment #3) > Also, in theory, we had to do a action=paraminfo query for each qery module > with such parameters because the limit could differ, so it would be much easier > to work with a continue tag which is telling us the actual limit. action=paraminfo can handle more than one module at one call. revids/titles/pageids is only one parameter and is not handled by each query module seperate, for that parameter you have only to call the paraminfo ones, but if you want all limits of all modules, you have to ask for each modules.
Was looking into this, but found out that ApiBase::setWarning() is a piece of crap that might need some rethinking.
WORKSFORME per comment 2