By default generates properties in random order. If order is desired, add the argument [{randomize_properties,false}] to json/2.