Am 01.09.2014 16:37, schrieb Markus Krötzsch:
There are two possible fixes:
* Correctly export empty maps as {}.
This would be the right way to do this, but the problem is that in php, an empty
map is indistinguishable from an empty list. So how do we tell the json encoder
when to use what?
* Do not export empty maps at all (leave away the
key).
That forces clients to always check the key first. Very annyoing. We are
actually trying to fix code that would leave keys unset. I'm surprised it would
still happen in the API, especially since the dump generator and the API are
using the same serializer implementation. Maybe the API does some special magic
when encoding to json?
So, I don't have a good solution right now...
-- daniel
--
Daniel Kinzler
Senior Software Developer
Wikimedia Deutschland
Gesellschaft zur Förderung Freien Wissens e.V.