When working with JSON, it's clear that relying on the ordering of key-value pairs may not be reliable. For instance, a JSON parser could interpret
{
"someKey" : "someValue",
"anotherKey" : "anotherValue",
"evenAnotherKey" : "evenAnotherValue"
}
differently as
{
"anotherKey" : "anotherValue",
"someKey" : "someValue",
"evenAnotherKey" : "evenAnotherValue"
}
which is legal. But what about the ordering in a JSON array? Could a JSON parser interpret
{
"arrayKey" : ["firstElement", "secondElement", "thirdElement"]
}
as
{
"arrayKey" : ["secondElement", "firstElement1", "thirdElement"]
}
legally? My assumption was no, but my friend argued otherwise.