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=pag…
https://en.wikipedia.org/w/api.php?action=query&titles=Elvis&prop=p…
This is mainly due to the fact that our API typically returns data as it
exists in the database, not in a form most usable or parsable for 3rd party
developers (unfortunately).
On Thu, May 28, 2015 at 2:58 PM, Brian Gerstle <bgerstle(a)wikimedia.org>
wrote:
For example:
"mainpage" field is omitted when querying Barack Obama
<
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=mobileview&form…
:
{
"mobileview": {
"pageprops": [],
"sections": []
}
}
But, it's present when querying Main Page
<
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=mobileview&form…
:
> {
> "mobileview": {
> "pageprops": [],
> "mainpage": "",
> "sections": [ ... ]
}
}
Is this the desired behavior?
--
EN Wikipedia user page:
https://en.wikipedia.org/wiki/User:Brian.gerstle
IRC: bgerstle
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l