User:Addshore/API Break September 2015: Difference between revisions

From Wikidata
Jump to navigation Jump to search
Content deleted Content added
TODO
rm notice
 
(5 intermediate revisions by the same user not shown)
Line 9: Line 9:
* Gerrit change: https://gerrit.wikimedia.org/r/#/c/227686
* Gerrit change: https://gerrit.wikimedia.org/r/#/c/227686
* Phabricator task: https://phabricator.wikimedia.org/T95168
* Phabricator task: https://phabricator.wikimedia.org/T95168
* Mailing list announcement link: TODO
* Mailing list announcement links:
** [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/2015-August/000095.html mediawiki-api-announce]

** [https://lists.wikimedia.org/pipermail/wikidata-tech/2015-August/000836.html wikidata-tech]
* Date merged into master: TODO
** [https://lists.wikimedia.org/pipermail/wikitech-l/2015-August/082949.html wikitech-l]
* Branch to first appear on: TODO
* Project announcement links:
* Date to be deployed to wikidata.beta.wmflabs.org: TODO
** [[Wikidata:Project_chat#API_breaking_change_.289th_September.29]]
* Date to be deployed to test.wikidata.org: TODO
** [[Wikidata_talk:Bots#API_breaking_change_.289th_September.29]]
* Date to be deployed to wikidata.org: TODO
* Date merged into master: 27 August 2015
* Branch to first appear on: 1.26wmf22
* Date to be deployed to wikidata.beta.wmflabs.org: 28th August 2015 >> current known issue https://phabricator.wikimedia.org/T110668
* Date to be deployed to test.wikidata.org: 8th September 2015
* Date to be deployed to wikidata.org: 9th September 2015


=== The breaking changes ===
=== The breaking changes ===
Line 37: Line 42:
==== Sample JSON changes ====
==== Sample JSON changes ====


Before:
TODO
<pre>
{
"entities": {
"q42": {
"id": "q42",
"revision": 31186,
"timestamp": "20120716140702",
"labels": {
"en": {
"language": "en",
"value": "Death Star"
},
"nn": {
"language": "nn",
"value": "Dødsstjerna"
}
},
"sitelinks": {
"enwiki": {
"site": "enwiki",
"title": "Death Star"
}
}
}
},
"success": 1
}
</pre>

After:
<pre>
{
"entities": {
"q42": {
"id": "q42",
"revision": 31186,
"timestamp": "20120716140702",
"labels": {
"en": {
"language": "en",
"value": "Death Star"
},
"nn": {
"language": "nn",
"value": "Dødsstjerna"
}
},
"descriptions": {},
"aliases": {},
"sitelinks": {
"enwiki": {
"site": "enwiki",
"title": "Death Star"
}
},
"claims": {}
}
},
"success": 1
}
</pre>


=== Finally ===
=== Finally ===

Latest revision as of 15:59, 2 June 2016

We have some breaking API changes that will soon be deployed to wikidata.org.

The breaks mainly concern the XML output although the JSON will also change slightly.

Below you can fine details about them!

Details

[edit]

The breaking changes

[edit]
  • XML output aliases are now grouped by language
  • XML output may no longer give elements when they are empty
  • XML any claim, qualifier, reference or snak elements that had an '_idx' element will no longer have it
  • ALL output may now give empty elements, ie. labels when an entity has none

Sample XML changes

[edit]

Sample JSON changes

[edit]

Before:

{
	"entities": {
		"q42": {
			"id": "q42",
			"revision": 31186,
			"timestamp": "20120716140702",
			"labels": {
				"en": {
					"language": "en",
					"value": "Death Star"
				},
				"nn": {
					"language": "nn",
					"value": "Dødsstjerna"
				}
			},
			"sitelinks": {
				"enwiki": {
					"site": "enwiki",
					"title": "Death Star"
				}
			}
		}
	},
	"success": 1
}

After:

{
	"entities": {
		"q42": {
			"id": "q42",
			"revision": 31186,
			"timestamp": "20120716140702",
			"labels": {
				"en": {
					"language": "en",
					"value": "Death Star"
				},
				"nn": {
					"language": "nn",
					"value": "Dødsstjerna"
				}
			},
			"descriptions": {},
			"aliases": {},
			"sitelinks": {
				"enwiki": {
					"site": "enwiki",
					"title": "Death Star"
				}
			},
            "claims": {}
		}
	},
	"success": 1
}

Finally

[edit]

As well as an API change you may also notice that the JSON dumps may increase in size, although the format will not change.

This will be due to the JSON format including empty parts where previously they were removed.

If you have any questions regarding these breaking changes please ask!

·addshore· talk to me! 11:51, 27 August 2015 (UTC)