Currently, a call such as
https://en.wikipedia.org/w/api.php?action=query&list=abusefilters&format=jsonfm&abflimit=2&abfprop=id%7Cdescription
correctly returns the id as a number, but other calls are not consistent with this and return them as strings:
Description
Details
- Reference
- bz52201
Related Objects
Event Timeline
While this could be fixed, it's good to explain why it's returned as a string: global filters. For instance, if you query AbuseLog, there may be a hit from global filters, for which the ID will be "global-xxx" with xxx being a number. The AbuseFilter/modify log could actually return it as an integer, since I think that will always be a local (numeric) ID. Abusefilters query instead returns it as int because it's a list of local filters, each one with a numeric ID.
Probably, the proper fix is to split it in filter_id and is_global, the first being a number and the second a boolean for AbuseLog. For AbuseFilter/modify, basically the same, but only if global filters are really included (otherwise, just use integers). Related to T42757.
@Daimona now that the global designation is separate from the filter ID, can this be actioned?
It's not separate yet. Only the schemas have been merged. We still have to get the new schemas on WMF wikis (T234052), then add the code for it (https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/459818/), and then complete the migration (which will take some time). However, yes, after the migration is complete this should be trivial (chances are, it could even get fixed during the process without noticing).