Page MenuHomePhabricator

API JSON formatversion=2 output incorrectly using strings for numbers and booleans
Open, Needs TriagePublic

Description

In the API output for JSON formatversion=2, e.g.

https://en.wikipedia.org/w/api.php?action=pagetriagelist&format=jsonfm&showunreviewed=1&limit=20&dir=oldestfirst&namespace=0&formatversion=2

https://en.wikipedia.org/w/api.php?action=pagetriagestats&topreviewers=last-week&format=jsonfm&formatversion=2

There are many pieces of data which are numbers or booleans which are incorrectly being output as strings. In formatversion=2, these should be output as numbers or booleans.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It should be listed here the names of the properties that are assumed to have an incorrect type. Note that some properties have a boolean type, like creator_user_page_exist in the first example.

In the code, boolean values have to be tagged with ApiResult::META_BC_BOOLS like it is already done for creator_user_page_exist in 25f4c711.