What JSON format is a better choice for key value pairs and why?
[{"key1": "value1"}, {"key2": "value2"}]
Or:
[{"Name": "key1", "Value": "value1"}, {"Name": "key2", "Value": "value2"}]
Or:
{"key1": "value1", "key2": "value2"}
The first variant seems more compact and more "semantically meaningful". The second variant seems more evenly structured which might help processing it. The 3rd variant seems even more semantic.
The key value pairs will be used to attach arbitrary data to some other item. The data must be serialized as JSON to round-trip it through a system.
{"key1": "value1", "key2": "value2"}
?