Why TJson.ObjectToJsonObject/ObjectToJsonString represents record fields as a JSON array? Why TJson.ObjectToJsonObject/ObjectToJsonString represents record fields as a JSON array? json json

Why TJson.ObjectToJsonObject/ObjectToJsonString represents record fields as a JSON array?


The Delphi output is legal JSON. Internally, REST.TJson is hard-coded to marshal a record as a JSON array. That is simply how it is implemented, it is by design, not a bug. It is just another way to represent data. SuperObject chooses to be more explicit. That is also OK. Two different implementations, two different representations. The JSON spec allows for both.