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
https://en.wikipedia.org/w/api.php?action=query&titles=Elvis&prop=pageprops&ppprop=disambiguation

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 <[email protected]>
wrote:

> For example:
>
> "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": {
> >         "pageprops": [],
> >         "sections": []
> >     }
> > }
>
>
> But, it's present when querying Main Page
> <
> https://en.wikipedia.org/wiki/Special:ApiSandbox#action=mobileview&format=json&page=Main_Page&prop=pageprops&pageprops=mainpage
> >
> :
>
> > {
> >     "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
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to