Page MenuHomePhabricator

action=query&meta=filerepoinfo reports boolean not in api way for xml format
Closed, ResolvedPublic

Description

When using action=query&meta=filerepoinfo the boolean attributes like local, fetchDescription or initialCapital does not follow the api rules for boolean.

Api rules for boolean in xml is a existing attribute for true and no attribute for false, but in this module a value of 1 is true and nothing is false, which can be missleading.

For json all looks okay, because the true/false is reported as is and not formatted to a string representing value like on xml.


Version: 1.23.0
Severity: normal

Details

Reference
bz59953

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:39 AM
bzimport set Reference to bz59953.
bzimport added a subscriber: Unknown Object (MLST).

If only it weren't for backwards compatibility, it'd be nice to actually return booleans as booleans everywhere in the non-XML formats rather than the silly present-with-falsey-value/absent that comes legacy from the XML format.

Yah, but mixed style is also bad, and when the one false looks like the other true, that is very bad.

That sounds like a idea for version 2.

Change 108315 had a related patch set uploaded by Umherirrender:
treat true as empty string, skip false in xml format

https://gerrit.wikimedia.org/r/108315

Change 108315 merged by jenkins-bot:
treat true as empty string, skip false in xml format

https://gerrit.wikimedia.org/r/108315

successfully merged, the xml format will now adjust the output for booleans, so trues are now empty strings and false skipped.
This allows using booleans for the other formats, which can make code path a bit easier (in the future), because no extra ifs are needed to add empty strings to the output, instead you can use the condition as is.