https://bugzilla.wikimedia.org/show_bug.cgi?id=67054
Bug ID: 67054
Summary: API mobileview "protection" sometimes returns object,
sometimes returns empty array in JSON output
Product: MobileFrontend
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General/Unknown
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Web browser: ---
Mobile Platform: ---
A protected page returns an object/map/dictionary/associative array for the
'protection' property:
http://en.wikipedia.org/w/api.php?action=mobileview&page=Barack_Obama&prop=protection|editable&format=json
{"mobileview":{"sections":[],"protection":{"edit":["autoconfirmed"],"move":["sysop"]},"editable":false}}
But an unprotected page seems to return an empty array instead of an object:
http://en.wikipedia.org/w/api.php?action=mobileview&page=Katakana&prop=protection|editable&format=json
{"mobileview":{"sections":[],"protection":[],"editable":true}}
PHP may consider those the same type, but JSON/JavaScript, Java, Objective-C,
etc consider them distinct types and we should be consistent in output to avoid
surprises in the clients.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l