Hi!

> It's that time of the year again when I am sending a reminder that we
> still have broken JSON in the dump files ;-). As usual, the problem is
> that empty maps {} are serialized wrongly as empty lists []. I am not

This seems to be consequence of using json_encode(), which does
serialize empty arrays as [], unless given JSON_FORCE_OBJECT option.
Unfortunately, this option would make all lists into objects (maps) so
we can't just use it directly. So probably the best way would be to just
drop the empty property? Unless it'd break something else.
Another trick would be to put there "new stdclass" instead of empty
array - that would encode to {}.
-- 
Stas Malyshev
smalys...@wikimedia.org

_______________________________________________
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l

Reply via email to