Hi, I'm generating a json from a map, however the final json though absolutely valid, loses the order of the items either in or out an object. This can be a bit problematic if a user decides to manually edit the json file, so it would be nice to have a solution. I will implement a function to re-organise the json, however in the mean time I'm really curious about why this may be happening.
Can anyone with a better vision on this, present the cause?
Here's the log of the original map:
And here's the json generated by the JSONGenerator:
Can anyone with a better vision on this, present the cause?
Here's the log of the original map:
Map:
(MyMap) {Description=test description, Input Port=BMT 1, Output Port=BMT 1, Sequences=[{Description=test desc, Active=Yes, Channel=0, Message Type=CC, Control Number=10, Value From=0, Value To=127, Diff From=0, Diff To=1, Operator=Or, Steps=[{Type=Keystrokes, Active=Yes, Keys=t e s t }]}]}
And here's the json generated by the JSONGenerator:
JSON:
{
"Sequences": [
{
"Operator": "Or",
"Steps": [
{
"Type": "Keystrokes",
"Active": "Yes",
"Keys": "t e s t "
}
],
"Active": "Yes",
"Diff From": "0",
"Description": "test desc",
"Value To": "127",
"Diff To": "1",
"Channel": "0",
"Value From": "0",
"Control Number": "10",
"Message Type": "CC"
}
],
"Description": "test description",
"Input Port": "BMT 1",
"Output Port": "BMT 1"
}