Hi Stas,
Since the JSON dumps and EntityData exports are (largely) free of errors, there is already code for fixing this problem. Maybe we could just use this.
Cheers,
Markus
On 27.02.2015 01:06, Stas Malyshev wrote:
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 {}.