Page MenuHomePhabricator

[Task] DataModelSerialization: represent map order in JSON output
Closed, InvalidPublic

Description

In JSON, the order of fields in an object is unspecified. In order to preserve the order of Statements, Qualifiers, References, etc, we need to represent it explicitly in the JSON output. One way is to give each element an index field. Another way is to have a special member in the associative map that is just a list of keys, giving their order.

Related Objects

StatusAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedAbit
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
DuplicateNone
InvalidLydia_Pintscher
OpenNone
OpenNone
OpenNone
OpenNone
StalledNone
ResolvedBene
OpenNone
ResolvedJanZerebecki
OpenNone
OpenNone
Resolvedthiemowmde
OpenNone
DeclinedBene
ResolvedBene
ResolvedBene
ResolvedBene
ResolvedAddshore
OpenNone
InvalidNone
Resolveddaniel
ResolvedBene
DeclinedBene

Event Timeline

daniel created this task.May 12 2015, 2:05 PM
daniel raised the priority of this task from to High.
daniel updated the task description. (Show Details)
daniel added subscribers: Bene, Wikidata-bugs, Tobi_WMDE_SW and 4 others.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 12 2015, 2:05 PM
JanZerebecki lowered the priority of this task from High to Normal.May 16 2015, 5:19 PM
JanZerebecki set Security to None.

This blocks "WikibaseDataModelSerialization with what we do with WikibaseLib" and although we have totally removed the Lib Serialization I would not consider this task complete in regards to WikibaseDataModelSerialization..

Right now we are doing the "Another way is to have a special member in the associative map that is just a list of keys, giving their order." one so I guess we should probably just keep doing that!

Python has OrderedDict, but I haven't heard of any way for JavaScript's JSON.parse() to use Map instead of Object.
Separate keys like qualifiers-order look like the safest workaround as of now.

Jonas renamed this task from DataModelSerialization: represent map order in JSON output to [Task] DataModelSerialization: represent map order in JSON output.Aug 15 2015, 12:21 PM
Lydia_Pintscher closed this task as Invalid.Apr 23 2017, 4:53 PM