SuLab / WikidataIntegrator

A Wikidata Python module integrating the MediaWiki API and the Wikidata SPARQL endpoint
MIT License
244 stars 46 forks source link

[Wikidata] [Breaking change] Empty containers in JSON outputs will be serialized as empty object "{}" #92

Closed andrawaag closed 5 years ago

andrawaag commented 5 years ago

Today aa breaking change is announced on Wikidata. This might affect WDI and should be tested.

Announcement: 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) 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, for example on this item. According to our 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: (redacted: https://phabricator.wikimedia.org/T138104>

Thanks for your attention,

-- Léa Lacroix Project Manager Community Communication for Wikidata

andrawaag commented 5 years ago

Did not affect our bots