Re: [Wikitech-l] API returns empty strings for boolean fields?

2015-05-29 Thread S Page
On Thu, May 28, 2015 at 2:58 PM, Brian Gerstle bgers...@wikimedia.org wrote: mainpage field is omitted when querying Barack Obama https://en.wikipedia.org/wiki/Special:ApiSandbox#action=mobileviewformat=jsonpage=Barack_Obamaprop=pagepropspageprops=mainpage : { mobileview: {

Re: [Wikitech-l] API returns empty strings for boolean fields?

2015-05-28 Thread Ryan Kaldari
That's pretty normal (but admittedly confusing). For example, if you do a query for a page property, it will return empty string for true and nothing for false (which both evaluate to false in PHP): https://en.wikipedia.org/w/api.php?action=querytitles=Bugprop=pagepropsppprop=disambiguation

Re: [Wikitech-l] API returns empty strings for boolean fields?

2015-05-28 Thread Ryan Kaldari
Feel free to reopen the declined bug: https://phabricator.wikimedia.org/T15299 I've always supported making our API more intuitive, but every bug I file about it gets declined :( On Thu, May 28, 2015 at 2:58 PM, Brian Gerstle bgers...@wikimedia.org wrote: For example: mainpage field is

Re: [Wikitech-l] API returns empty strings for boolean fields?

2015-05-28 Thread Legoktm
On 05/28/2015 02:58 PM, Brian Gerstle wrote: Is this the desired behavior? Yes-ish. It's a leftover from when XML was the primary API format. If you pass formatversion=2 in the request, you'll get proper booleans (as well as other improvements). I re-closed

[Wikitech-l] API returns empty strings for boolean fields?

2015-05-28 Thread Brian Gerstle
For example: mainpage field is omitted when querying Barack Obama https://en.wikipedia.org/wiki/Special:ApiSandbox#action=mobileviewformat=jsonpage=Barack_Obamaprop=pagepropspageprops=mainpage : { mobileview: { pageprops: [], sections: [] } } But, it's present

Re: [Wikitech-l] API returns empty strings for boolean fields?

2015-05-28 Thread Ryan Kaldari
Guess I shouldn't be so quick to complain ;) Thanks Anomie and others for finally fixing that 7-year-old bug! On Thu, May 28, 2015 at 4:17 PM, Legoktm legoktm.wikipe...@gmail.com wrote: On 05/28/2015 02:58 PM, Brian Gerstle wrote: Is this the desired behavior? Yes-ish. It's a leftover from