Closed zakimohzani closed 8 years ago
@zakimohzani JSON object has unordered fields according to the JSON specification. If your code rely on the order of JSON fields, you should stop doing so.
Ah ok, thanks for that. I mentioned it because a + b for Matlab requires that both a n b structs to have their fields in the same order for performance reasons. If this is the case for JSON, then I'll include the order in another field :) Am 24.03.2016 4:03 Nachm. schrieb "Kota Yamaguchi" <notifications@github.com
:
@zakimohzani https://github.com/zakimohzani JSON object has unordered fields according to the JSON specification http://json.org. If your code rely on the order of JSON fields, you should stop doing so.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/kyamagu/matlab-json/issues/6#issuecomment-200723216
Hello Mr. Yamaguchi,
Just for the benefit of other users, I've found another bug while testing simple stuff on json0.2.2:
json.write fails to preserve field order. Example:
Result is:
And that's the order I get when using json.read
On the other hand, the JSONLab library on MathWorks handles this properly.
Thanks for your efforts. You don't need to solve this.