Push-f created this task. Push-f added projects: Wikibase-DataModel-Serialization, Wikidata. Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION The `TypedSnakSerializer` of the DataModel Serialization library currently inserts the datatype <https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/f749048378bff354219867d86cea94de1e6a003a/lib/packages/wikibase/data-model-serialization/src/Serializers/TypedSnakSerializer.php#53> after the snak has already been constructed and because PHP arrays are ordered this results in snaks like the following: { "snaktype": "value", "property": "P958", "hash": "66529858390d6dc4356a30e5069c01a05e17f757", "datavalue": { "value": "Human Race", "type": "string" }, "datatype": "string" } note how `datatype` comes after the `datavalue`. This is quite unfortunate because it disallows the most efficient deserialization (single pass and no allocations). So I think it would be nice if `TypedSnakSerializer` put the `datatype` before the `datavalue` to allow for most efficient deserialization. TASK DETAIL https://phabricator.wikimedia.org/T323618 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Push-f Cc: Push-f, Aklapper, Astuthiodit_1, karapayneWMDE, Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
