[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 : > { > "mobileview": { > "pageprops": [], > "sections": [] > } > } Bu

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=query&titles=Bug&prop=pageprops&ppprop=disambiguation http

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 wrote: > For example: > > "mainpage" field is omitted when querying B

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

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 wrote: > 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 primar

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 wrote: > > "mainpage" field is omitted when querying Barack Obama > < > https://en.wikipedia.org/wiki/Special:ApiSandbox#action=mobileview&format=json&page=Barack_Obama&prop=pageprops&pageprops=mainpage > > > : > > > { > > "mobileview": { > >