Always sort by key when writing JSON