FYI, we have
https://phabricator.wikimedia.org/T219891 for this.
-------- Forwarded Message --------
Subject: [Wikidata-tech] [Breaking change] Empty containers in JSON
outputs will be serialized as empty object "{}"
Date: Tue, 2 Apr 2019 12:23:37 +0200
From: Léa Lacroix <lea.lacroix(a)wikimedia.de>
Reply-To: Wikidata technical discussion
<wikidata-tech(a)lists.wikimedia.org>
To: Discussion list for the Wikidata project.
<wikidata(a)lists.wikimedia.org>rg>, Wikidata technical discussion
<wikidata-tech(a)lists.wikimedia.org>
Hello all,
This change is relevant for everyone *using APIs, JSON output and dumps
in their tools or gadgets*.
Currently, when an object is empty (for example descriptions and
aliases), it is rendered as an empty array |[]| in JSON. (Example
<https://www.wikidata.org/wiki/Special:EntityData/Q24075199.json>) We
want to serialized it as an empty object |{}| instead. This change will
ease the deserialization process and bring more consistency in our code
as some other places already use JSON objects instead of arrays.
The impact of this change will be in JSON outputs (Special:EntityData)
and JSON dumps, as well as the output of wbgetentities, wbgetclaims and
editing APIs.
If you’re maintaining tools that use Special:EntityData, you may want to
check your code to make sure that it reflects this change, e.g. items
with no labels, descriptions, aliases or sitelinks are properly
deserialized by your tool.
You can already *test your code* against our test system on
beta.wikidata.org <http://beta.wikidata.org>, for example on this item
<https://wikidata.beta.wmflabs.org/wiki/Special:EntityData/Q521829.json>.
According to our stable interface policy
<https://www.wikidata.org/wiki/Wikidata:Stable_Interface_Policy>, the
change will be enabled four weeks after this announcement, on April 30th.
In the meantime, if you have any issue or question, feel free to leave a
comment in this ticket <https://phabricator.wikimedia.org/T138104>.
Thanks for your attention,
--
Léa Lacroix
Project Manager Community Communication for Wikidata
Wikimedia Deutschland e.V.
Tempelhofer Ufer 23-24
10963 Berlin
www.wikimedia.de <http://www.wikimedia.de>
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
unter der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das
Finanzamt für Körperschaften I Berlin, Steuernummer 27/029/42207.