On 04/28/2015 05:31 PM, Dan Garry wrote:
I've noticed something a little strange about the
"editable" key that
the mobileview API returns. It seems it's either "true" or the empty
string if the page is editable, or either "false" or absent from the
response if the page is not editable. Whether it goes for the empty
string/absent or true/false approach seems to vary from wiki to wiki.
The mobileview API was outputting a raw "true" or "false" boolean,
against the previous API standards which was to add the key with empty
string for true, and omit for false. The new API code present in
1.26wmf3 (on group0+1 wikis, hits group2 tomorrow) automatically
converts raw booleans to the previous format so developers can easily
transition to formatversion=2 which handles all of this in a sane
manner. It's a trivial fix, I'll submit a patch momentarily, which
should likely be backported.
Does anyone know why this is? It'd be nice if this
could be changed,
because it's a pain to deal with things like this in a strongly-typed
language like Java.
Changed to what? I think it would be a pain to deal with in any language ;-)
-- Legoktm