They might rearrange keys in a JSON object, but in an array they should be preserved in order as according to the spec[1]. If Swift does this (which I can&#x27;t really check) than this would be a bug.<p>[1] <a href="http:&#x2F;&#x2F;www.json.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.json.org&#x2F;</a>: An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).